ListBoxMessages Enumeration

The system sends or posts a system-defined message when it communicates with an application.

It uses these messages to control the operations of applications and to provide input and other information for applications to process.

An application can also send or post system-defined messages.

Applications generally use these messages to control the operation of control windows created by using preregistered window classes.

Definition

Namespace: DevCase.Win32.Enums
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public enum ListBoxMessages

Remarks

https://msdn.microsoft.com/en-us/library/windows/desktop/ff485967%28v=vs.85%29.aspx

The definitions can be found in the Windows SDK file: WinUser.h

Members

Null 0 The Null message performs no operation.

An application sends the Null message if it wants to post a message that the recipient window will ignore.

AddString 384 Adds a string to a ListBox. If the ListBox does not have the LBS_SORT style, the string is added to the end of the list.

Otherwise, the string is inserted into the list and the list is sorted.

InsertString 385 Inserts a string or item data into a ListBox.

Unlike the AddString message, the InsertString message does not cause a list with the LBS_SORT style to be sorted.

DeleteString 386 Deletes a string in a ListBox.
ResetContent 388 Removes all items from a ListBox.
SetSel 389 Selects an item in a multiple-selection ListBox and, if necessary, scrolls the item into view.
SetCurSel 390 Selects a string and scrolls it into view, if necessary.

When the new string is selected, the ListBox removes the highlight from the previously selected string.

GetSel 391 Gets the selection state of a ListBox item.
GetCurSel 392 Gets the index of the currently selected item, if any, in a single-selection ListBox
GetText 393 Gets a string from a ListBox.
GetCount 395 Gets the number of items in a ListBox.
SelectString 396 Use this message only with single-selection list boxes.

You cannot use it to set or remove a selection in a multiple-selection ListBox.

GetTopIndex 398 Gets the index of the first visible item in a ListBox.

Initially the item with index

C#
No code example is currently available or this language may not be supported.
is at the top of the ListBox, but if the ListBox contents have been scrolled another item may be at the top.

The first visible item in a multiple-column list box is the top-left item.

FindString 399 Finds the first string in a ListBox that begins with the specified string.
GetSelCount 400 Gets the total number of selected items in a multiple-selection ListBox.
GetSelItems 401 Fills a buffer with an array of integers that specify the item numbers of selected items in a multiple-selection ListBox.
GetHorizontalExtent 403 Gets the width, in pixels, that a ListBox can be scrolled horizontally (the scrollable width) if the ListBox has a horizontal scroll bar.
SetHorizontalExtent 404 Sets the width, in pixels, by which a ListBox can be scrolled horizontally (the scrollable width).

If the width of the list box is smaller than this value, the horizontal scroll bar horizontally scrolls items in the list box.

If the width of the list box is equal to or greater than this value, the horizontal scroll bar is hidden.

SetTopIndex 407 Ensures that the specified item in a ListBox is visible.
GetItemData 409 Gets the application-defined value associated with the specified ListBox item.
SetItemData 410 Sets a value associated with the specified item in a ListBox item.

See Also