Notification Messages from List Boxes
When an event occurs in a list box, the list box sends a notification message to the dialog box procedure of the owner window. List box notification messages are sent when a user selects, double-clicks, or cancels a list box item; when the list box receives or loses the keyboard focus; and when the system cannot allocate enough memory for a list box request. A notification message is sent as a WM_COMMAND message in which the low-order word of the wParam parameter contains the list box identifier, the high-order word of wParam contains the notification message, and the lParam parameter contains the control window handle.
Portability Issue The placement of notification message has moved from the lParam parameter to the wParam parameter. Windows 3.x - based applications that process notification messages must be modified in this respect when they are ported to Win32-based applications.
A dialog box procedure is not required to process these messages; the default window procedure processes them.
An application should monitor and process the following list box notification messages.
Notification message | Description |
LBN_DBLCLK | The user double-clicks an item in the list box. |
LBN_ERRSPACE | The list box cannot allocate enough memory to fulfill a request. |
LBN_KILLFOCUS | The list box loses the keyboard focus. |
LBN_SELCANCEL | The user cancels the selection of an item in the list box. |
LBN_SELCHANGE | The selection in a list box is about to change. |
LBN_SETFOCUS | The list box receives the keyboard focus. |