Handling Control Messages
In the two earlier sections on mouse and keyboard messages, there
was no distinction on which messages were available to dialogs or
common controls. For each of these, this tutorial will discuss
notifications that are available through the callbacks or through
subclassing.
Background Information
Before getting into specific control messages, two general
information items are worth discussing.
Common Control Messages
Click on the link to jump to the notification information for
each control.
Button
Here is the notification information for the MSDN button control.
The PowerBASIC controls that are derived from the button common
control are button, check3state, checkbox, frame, imgbutton,
imgbuttonx, and option.
MSDN Notifications Value
------------------ -----
%WM_COMMAND
%BN_CLICKED 0
%BN_DBLCLK 5
%BN_DISABLE 4
%BN_DOUBLECLICKED 5
%BN_HILITE 2
%BN_KILLFOCUS 7
%BN_PAINT 1
%BN_PUSHED
%BN_SETFOCUS 6
%BN_UNHILITE 3
%BN_UNPUSHED
%WM_NOTIFY
%BCN_DROPDOWN
%BCN_HOTITEMCHANGE
%NM_CUSTOMDRAW 12
%WM_CTLCOLORBTN
For %BN_KILLFOCUS and %BN_SETFOCUS to be received, the control
style must include %BS_NOTIFY.
Since control callbacks only receive notifications via
%WM_COMMAND and %WM_NOFITY, they will not receive the %WM_CTLCOLORBTN
notification. A dialog callback, however, can receive
%WM_CTLCOLORBTN.
Button Notification Definitions (from MSDN)
- BCN_DROPDOWN
Sent when the user clicks a drop down arrow
on a button. The parent window of the control
receives this notification message in the form
of a WM_NOTIFY message.
- BCN_HOTITEMCHANGE
Notifies the button control owner that the mouse
is entering or leaving the client area of the
button control. The button control sends this
notification in the form of a WM_NOTIFY message.
- BN_CLICKED
Sent when the user clicks a button. The parent window of
the button receives the BN_CLICKED notification code through
the WM_COMMAND message.
- BN_DBLCLK
Sent when the user double-clicks a button.
This notification is sent automatically for
BS_USERBUTTON, BS_RADIOBUTTON, and BS_OWNERDRAW
buttons. Other button types send BN_DBLCLK only
if they have the BS_NOTIFY style.
The parent window of the button receives the BN_DBLCLK
notification code through the WM_COMMAND message.
- BN_DBLCLK
Sent when the user double-clicks a button. This notification
is sent automatically for BS_USERBUTTON, BS_RADIOBUTTON, and
BS_OWNERDRAW buttons. Other button types send BN_DBLCLK only
if they have the BS_NOTIFY style.
The parent window of the button receives the BN_DBLCLK
notification code through the WM_COMMAND message.
- BN_DISABLE
Sent when a button is disabled. Note This notification message
is provided only for compatibility with 16-bit versions of Microsoft
Windows earlier than version 3.0. Applications should use the
BS_OWNERDRAW button style and the DRAWITEMSTRUCT structure for this
task.
The parent window of the button receives the BN_DISABLE notification
code through the WM_COMMAND message.
- BN_DOUBLECLICKED
Sent when the user double-clicks a button. This notification
is sent automatically for BS_USERBUTTON, BS_RADIOBUTTON, and
BS_OWNERDRAW buttons. Other button types send BN_DOUBLECLICKED
only if they have the BS_NOTIFY style.
The parent window of the button receives the BN_DOUBLECLICKED
notification code through the WM_COMMAND message.
- BN_HILITE
Sent when the user selects a button. Note This notification message
is provided only for compatibility with 16-bit versions of Microsoft
Windows earlier than version 3.0. Applications should use the
BS_OWNERDRAW button style and the DRAWITEMSTRUCT structure for this
task.
The parent window of the button receives the BN_HILITE
notification code through the WM_COMMAND message.
- BN_KILLFOCUS
Sent when a button loses the keyboard focus. The button must have
the BS_NOTIFY style to send this notification message.
The parent window of the button receives the BN_KILLFOCUS
notification code through the WM_COMMAND message.
- BN_PAINT
Sent when a button should be painted. Note This notification message
is provided only for compatibility with 16-bit versions of Microsoft
Windows earlier than version 3.0. Applications should use the
BS_OWNERDRAW button style and the DRAWITEMSTRUCT structure for this
task.
The parent window of the button receives the BN_PAINT
notification code through the WM_COMMAND message.
- BN_PUSHED
Sent when the push state of a button is set to pushed. Note This
notification message is provided only for compatibility with 16-bit
versions of Microsoft Windows earlier than version 3.0. Applications
should use the BS_OWNERDRAW button style and the DRAWITEMSTRUCT
structure for this task.
The parent window of the button receives the BN_PUSHED
notification code through the WM_COMMAND message.
- BN_SETFOCUS
Sent when a button receives the keyboard focus. The button must have
the BS_NOTIFY style to send this notification message.
The parent window of the button receives the BN_SETFOCUS notification
code through the WM_COMMAND message.
- BN_UNHILITE
Sent when the highlight should be removed from a button. Note This
notification message is provided only for compatibility with 16-bit
versions of Microsoft Windows earlier than version 3.0. Applications
should use the BS_OWNERDRAW button style and the DRAWITEMSTRUCT
structure for this task.
The parent window of the button receives the BN_UNHILITE
notification code through the WM_COMMAND message.
- BN_UNPUSHED
Sent when the push state of a button is set to unpushed. Note This
notification message is provided only for compatibility with 16-bit
versions of Microsoft Windows earlier than version 3.0. Applications
should use the BS_OWNERDRAW button style and the DRAWITEMSTRUCT
structure for this task.
The parent window of the button receives the BN_UNPUSHED
notification code through the WM_COMMAND message.
- NM_CUSTOMDRAW
Notifies the parent window of a button control about custom draw
operations on the button.
The button control sends this notification in the form of a WM_NOTIFY
message.
- WM_CTLCOLORBTN
The WM_CTLCOLORBTN message is sent to the parent window of a button
before drawing the button. The parent window can change the button's
text and background colors. However, only owner-drawn buttons respond
to the parent window processing this message.
Combobox
Here is the notification information for the MSDN combobox control.
MSDN Notifications Value
------------------ -----
%WM_COMMAND
%CBN_CLOSEUP
%CBN_DBLCLK
%CBN_DROPDOWN
%CBN_EDITCHANGE
%CBN_EDITUPDATE
%CBN_ERRSPACE
%CBN_KILLFOCUS
%CBN_SELCHANGE
%CBN_SELENDCANCEL
%CBN_SELENDOK
%CBN_SETFOCUS
%WM_COMPAREITEM
%WM_DRAWITEM
%WM_MEASUREITEM
Since control callbacks only receive notifications via
%WM_COMMAND and %WM_NOTIFY, they will not receive the
%WM_COMPAREITEM, %WM_DRAWITEM, and %WM_MEASUREITEM messages.
A dialog callback, however, can receive them.
Combobox Notification Definitions (from MSDN)
- CBN_CLOSEUP
Sent when the list box of a combo box has been closed. The parent window of the combo box receives this notification message through the WM_COMMAND message.
- CBN_DBLCLK
Sent when the user double-clicks a string in the list box of a combo box. The parent window of the combo box receives this notification message through the WM_COMMAND message.
- CBN_DROPDOWN
Sent when the list box of a combo box is about to be made visible. The parent window of the combo box receives this notification message through the WM_COMMAND message.
- CBN_EDITCHANGE
Sent after the user has taken an action that may have altered the text in the edit control portion of a combo box. Unlike the CBN_EDITUPDATE notification message, this notification message is sent after the system updates the screen. The parent window of the combo box receives this notification message through the WM_COMMAND message.
- CBN_EDITUPDATE
Sent when the edit control portion of a combo box is about to display altered text. This notification message is sent after the control has formatted the text, but before it displays the text. The parent window of the combo box receives this notification message through the WM_COMMAND message.
- CBN_ERRSPACE
Sent when a combo box cannot allocate enough memory to meet a specific request. The parent window of the combo box receives this notification message through the WM_COMMAND message.
- CBN_KILLFOCUS
Sent when a combo box loses the keyboard focus. The parent window of the combo box receives this notification message through the WM_COMMAND message.
- CBN_SELCHANGE
Sent when the user changes the current selection in the list box of a combo box. The user can change the selection by clicking in the list box or by using the arrow keys. The parent window of the combo box receives this notification in the form of a WM_COMMAND message with CBN_SELCHANGE in the high-order word of the wParam parameter.
- CBN_SELENDCANCEL
Sent when the user selects an item, but then selects another control or closes the dialog box. It indicates the user's initial selection is to be ignored. The parent window of the combo box receives this notification message through the WM_COMMAND message.
- CBN_SELENDOK
Sent when the user selects a list item, or selects an item and then closes the list. It indicates that the user's selection is to be processed. The parent window of the combo box receives this notification message through the WM_COMMAND message.
- CBN_SETFOCUS
Sent when a combo box receives the keyboard focus. The parent window of the combo box receives this notification message through the WM_COMMAND message.
- WM_COMPAREITEM
The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style.
- WM_DRAWITEM
The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.
A window receives this message through its WindowProc function.
- WM_MEASUREITEM
The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created.
A window receives this message through its WindowProc function.
Static Control
Here is the notification information for the MSDN static control.
The PowerBASIC controls that are derived from the static common
control are graphic, image, imagex, label and line.
MSDN Notifications Value
------------------ -----
%WM_COMMAND
STN_CLICKED
STN_DBLCLK
STN_DISABLE
STN_ENABLE
WM_CTLCOLORSTATIC
Static Control Notification Definitions (from MSDN)
- STN_Clicked
The STN_CLICKED notification message is sent when the user clicks a static control
that has the SS_NOTIFY style. The parent window of the control receives this
notification message through the WM_COMMAND message.
- STN_DblClk
The STN_DBLCLK notification message is sent when the user double-clicks a static
control that has the SS_NOTIFY style. The parent window of the control receives
this notification message through the WM_COMMAND message.
- STN_Disable
The STN_DISABLE notification message is sent when a static control is disabled.
The static control must have the SS_NOTIFY style to receive this notification
message. The parent window of the control receives this notification message
through the WM_COMMAND message.
- STN_Enable
The STN_ENABLE notification message is sent when a static control is enabled.
The static control must have the SS_NOTIFY style to receive this notification
message. The parent window of the control receives this notification message
through the WM_COMMAND message.
- WM_CtlColorStatic
A static control, or an edit control that is read-only or disabled, sends the
WM_CTLCOLORSTATIC message to its parent window when the control is about to be
drawn. By responding to this message, the parent window can use the specified
device context handle to set the text and background colors of the static control.
A window receives this message through its WindowProc function.
ListBox
Here is the notification information for the MSDN listbox control.
MSDN Notifications Value
------------------ -----
%WM_COMMAND
LBN_DBLCLK
LBN_ERRSPACE
LBN_KILLFOCUS
LBN_SELCANCEL
LBN_SELCHANGE
LBN_SETFOCUS
WM_CHARTOITEM
WM_CTLCOLORLISTBOX
WM_DELETEITEM
WM_VKEYTOITEM
For %LBN_DBLCLK to be received, the control
style must include %LBS_NOTIFY.
Since control callbacks only receive notifications via
%WM_COMMAND and %WM_NOTIFY, they will not receive the
WM_CHARTOITEM, WM_CTLCOLORLISTBOX, WM_DELETEITEM or
WM_VKEYTOITEM messages. A dialog callback, however,
can receive them.
ListBox Notification Definitions (from MSDN)
- LBN_DBLCLK
Notifies the application that the user has double-clicked an item in a list box. The parent window of the list box receives this notification message through the WM_COMMAND message.
- LBN_DBLCLK
Notifies the application that the user has double-clicked an item in a list box. The parent window of the list box receives this notification message through the WM_COMMAND message.
- LBN_DBLCLK
Notifies the application that the user has double-clicked an item in a list box. The parent window of the list box receives this notification message through the WM_COMMAND message.
- LBN_SELCANCEL
Notifies the application that the user has canceled the selection in a list box. The parent window of the list box receives this notification message through the WM_COMMAND message.
- LBN_SELCHANGE
Notifies the application that the selection in a list box has changed. The parent window of the list box receives this notification message through the WM_COMMAND message.
- LBN_SETFOCUS
Notifies the application that the list box has received the keyboard focus. The parent window of the list box receives this notification message through the WM_COMMAND message.
- WM_CHARTOITEM
Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message.
- WM_CTLCOLORLISTBOX
Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle.
- WM_DELETEITEM
Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data.
- WM_VKEYTOITEM
Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message.
ListView
Here is the notification information for the MSDN listview control.
MSDN Notifications Value
------------------ -----
%WM_NOTIFY
LVN_DELETEITEM
LVN_ENDLABELEDIT
LVN_ENDSCROLL
LVN_GETDISPINFO
LVN_GETEMPTYMARKUP
LVN_GETINFOTIP
LVN_HOTTRACK
LVN_INCREMENTALSEARCH
LVN_INSERTITEM
LVN_ITEMACTIVATE
LVN_ITEMCHANGED
LVN_ITEMCHANGING
LVN_KEYDOWN
LVN_LINKCLICK
LVN_MARQUEEBEGIN
LVN_ODCACHEHINT
LVN_ODFINDITEM
LVN_ODSTATECHANGED
LVN_SETDISPINFO
NM_CLICK
NM_CUSTOMDRAW
NM_DBLCLK
NM_HOVER
NM_KILLFOCUS
NM_RCLICK
NM_RDBLCLK
NM_RELEASEDCAPTURE
NM_RETURN
NM_SETFOCUS
ListView Notification Definitions (from MSDN)
- LVN_BEGINDRAG
Notifies a list-view control's parent window that a drag-and-drop operation involving the left mouse button is being initiated. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_BEGINLABELEDIT
Notifies a list-view control's parent window about the start of label editing for an item. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_BEGINRDRAG
Notifies a list-view control's parent window that a drag-and-drop operation involving the right mouse button is being initiated. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_BEGINSCROLL
Notifies a list-view control's parent window when a scrolling operation starts.
- LVN_COLUMNCLICK
Notifies a list-view control's parent window that a column was clicked. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_COLUMNDROPDOWN
Sent by a list-view control when the list-view's drop-down button is pressed. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_COLUMNOVERFLOWCLICK
Sent by a list-view control when its overflow button is clicked. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_DELETEALLITEMS
Notifies a list-view control's parent window that all items in the control are about to be deleted. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_DELETEITEM
Notifies a list-view control's parent window that an item is about to be deleted. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_ENDLABELEDIT
Notifies a list-view control's parent window about the end of label editing for an item. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_ENDSCROLL
Notifies a list-view control's parent window when a scrolling operation ends.
- LVN_GETDISPINFO
Sent by a list-view control to its parent window. It is a request for the parent window to provide information needed to display or sort a list-view item. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_GETEMPTYMARKUP
Sent by list-view control to its parent window when the control has no items. This notification message is sent in the form of a WM_NOTIFY message. The LVN_GETEMPTYMARKUP notification message is a request for the parent window to provide markup text.
- LVN_GETINFOTIP
Sent by a large icon view list-view control that has the LVS_EX_INFOTIP extended style. This notification is sent when the list-view control is requesting additional text information to be displayed in a ToolTip. It is sent in the form of a WM_NOTIFY message.
- LVN_HOTTRACK
Sent by a list-view control when the user moves the mouse over an item. This notification is only sent by list-view controls that have the LVS_EX_TRACKSELECT extended list-view style. It is sent in the form of a WM_NOTIFY message.
- LVN_INCREMENTALSEARCH
Notifies a list-view control's parent window that an incremental search has started. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_INSERTITEM
Notifies a list-view control's parent window that a new item was inserted. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_ITEMACTIVATE
Sent by a list-view control when the user activates an item. This notification is sent in the form of a WM_NOTIFY message.
- LVN_ITEMCHANGED
Notifies a list-view control's parent window that an item has changed. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_ITEMCHANGING
Notifies a list-view control's parent window that an item is changing. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_KEYDOWN
Notifies a list-view control's parent window that a key has been pressed. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_LINKCLICK
Notifies a list-view control's parent window that a link has been clicked on. This notification is sent in the form of a WM_NOTIFY message.
- LVN_MARQUEEBEGIN
Notifies a list-view control's parent window that a bounding box (marquee) selection has begun. This notification message is sent in the form of a WM_NOTIFY message.
- LVN_ODCACHEHINT
Sent by a virtual list-view control when the contents of its display area have changed. For example, a list-view control sends this notification when the user scrolls the control's display. The LVN_ODCACHEHINT notification message is sent in the form of a WM_NOTIFY message.
- LVN_ODFINDITEM
Sent by a virtual list-view control when it needs the owner to find a particular callback item. For example, the control will send this notification when it receives shortcut keyboard input or when it receives an LVM_FINDITEM message.
- LVN_ODSTATECHANGED
Sent by a list-view control when the state of an item or range of items has changed. This notification is sent in the form of a WM_NOTIFY message.
- LVN_SETDISPINFO
Notifies a list-view control's parent window that it must update the information it maintains for an item. This notification message is sent in the form of a WM_NOTIFY message.
- NM_CLICK
Sent by a list-view control when the user clicks an item with the left mouse button. This notification message is sent in the form of a WM_NOTIFY message.
- NM_CUSTOMDRAW
Sent by a list-view control to notify its parent windows about drawing operations. This notification is sent in the form of a WM_NOTIFY message.
- NM_DBLCLK
Sent by a list-view control when the user double-clicks an item with the left mouse button. This notification message is sent in the form of a WM_NOTIFY message.
- NM_HOVER
Sent by a list-view control when the mouse hovers over an item. This notification message is sent in the form of a WM_NOTIFY message.
- NM_KILLFOCUS
Notifies a list-view control's parent window that the control has lost the input focus. NM_KILLFOCUS (list view) is sent in the form of a WM_NOTIFY message.
- NM_RCLICK
Sent by a list-view control when the user clicks an item with the right mouse button. This notification message is sent in the form of a WM_NOTIFY message.
- NM_RDBLCLK
Sent by a list-view control when the user double-clicks an item with the right mouse button. This notification message is sent in the form of a WM_NOTIFY message.
- NM_RELEASEDCAPTURE
Notifies a list-view control's parent window that the control is releasing mouse capture. This notification is sent in the form of a WM_NOTIFY message.
- NM_RELEASEDCAPTURE
Notifies a list-view control's parent window that the control is releasing mouse capture. This notification is sent in the form of a WM_NOTIFY message.
- NM_SETFOCUS
Notifies a list-view control's parent window that the control has received the input focus. NM_SETFOCUS (list view) is sent in the form of a WM_NOTIFY message.
Progress Bar
There are no notifications for the MSDN progress bar control.
Scroll Bar
Here is the notification information for the MSDN scroll bar control.
There are no %WM_COMMAND or %WM_NOTIFY notifications for a scroll bar.
MSDN Notifications Value
------------------ -----
%WM_CTLCOLORSCROLLBAR
%WM_HSCROLL
%WM_VSCROLL
Since control callbacks only receive notifications via
%WM_COMMAND and %WM_NOTIFY, they will not receive the
%WM_CTLCOLORSCROLLBAR, %WM_HSCROLL, or %WM_SCROLL
messages. A dialog callback, however, can receive them.
Scroll Bar Notification Definitions (from MSDN)
- WM_CTLCOLORSCROLLBAR
The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control.
A window receives this message through its WindowProc function.
- WM_HSCROLL
The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control.
A window receives this message through its WindowProc function.
- WM_VSCROLL
The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control.
A window receives this message through its WindowProc function.
Status Bar
Here is the notification information for the MSDN status bar control.
MSDN Notifications Value
------------------ -----
%WM_NOTIFY
%NM_CLICK
%NM_DBLCLK
%NM_RCLICK
%NM_RDBLCLK
5SBN_SIMPLEMODECHANGE
Status Bar Notification Definitions (from MSDN)
- NM_CLICK
Notifies the parent window of a status bar control that the user has clicked the left mouse button within the control. NM_CLICK (status bar) is sent in the form of a WM_NOTIFY message.
- NM_DBLCLK
Notifies the parent window of a status bar control that the user has double-clicked the left mouse button within the control. This notification is sent in the form of a WM_NOTIFY message.
- NM_RCLICK
Notifies the parent window of a status bar control that the user has clicked the right mouse button within the control. This notification is sent in the form of a WM_NOTIFY message.
- NM_RDBLCLK
Notifies the parent windows of a status bar control that the user has double-clicked the right mouse button within the control. NM_RDBLCLK (status bar) is sent in the form of a WM_NOTIFY message.
- SBN_SIMPLEMODECHANGE
Sent by a status bar control when the simple mode changes due to a SB_SIMPLE message. This notification is sent in the form of a WM_NOTIFY message.
TAB
Here is the notification information for the MSDN tab control.
MSDN Notifications Value
------------------ -----
%WM_NOTIFY
%NM_CLICK
%NM_DBLCLK
%NM_RCLICK
%NM_RDBLCLK
%NM_RELEASEDCAPTURE
%TCN_FOCUSCHANGE
%TCN_GETOBJECT
%TCN_KEYDOWN
%TCN_SELCHANGE
%TCN_SELCHANGING
TextBox Notification Definitions (from MSDN)
- NM_CLICK
Notifies the parent window of a tab control that the user has clicked the left mouse button within the control. NM_CLICK (tab) is sent in the form of a WM_NOTIFY message.
- NM_DBLCLK
Notifies a parent window of a tab control that the user has double-clicked the left mouse button within the control. This notification is sent in the form of a WM_NOTIFY message
- NM_RCLICK
Notifies the parent window of a tab control that the user has clicked the right mouse button within the control. NM_RCLICK (tab) is sent in the form of a WM_NOTIFY message.
- NM_RELEASEDCAPTURE
Notifies a tab control's parent window that the control is releasing mouse capture. This notification is sent in the form of a WM_NOTIFY message.
- TCN_FOCUSCHANGE
Notifies a tab control's parent window that the button focus has changed.
- TCN_GETOBJECT
Sent by a tab control when it has the TCS_EX_REGISTERDROP extended style and an object is dragged over a tab item in the control. This notification message is sent in the form of a WM_NOTIFY message.
- TCN_KEYDOWN
Notifies a tab control's parent window that a key has been pressed. This message is sent in the form of a WM_NOTIFY message.
- TCN_SELCHANGE
Notifies a tab control's parent window that the currently selected tab has changed. This message is sent in the form of a WM_NOTIFY message.
- TCN_SELCHANGING
Notifies a tab control's parent window that the currently selected tab is about to change. This message is sent in the form of a WM_NOTIFY message.
TextBox
Here is the notification information for the MSDN textbox control.
MSDN Notifications Value
------------------ -----
%WM_COMMAND
%EN_ALIGN_LTR_EC
%EN_ALIGN_RTL_EC
%EN_CHANGE
%EN_ERRSPACE
%EN_HSCROLL
%EN_KILLFOCUS
%EN_MAXTEXT
%EN_SETFOCUS
%EN_UPDATE
%EN_VSCROLL
%WM_CTLCOLOREDIT
Since control callbacks only receive notifications via
%WM_COMMAND and %WM_NOTIFY, they will not receive the
%WM_CTLCOLOREDIT message. A dialog callback, however,
can receive it.
TextBox Notification Definitions (from MSDN)
- EN_ALIGN_LTR_EC
Sent when the user has changed the edit control direction to left-to-right. The parent window of the edit control receives this notification message through a WM_COMMAND message.
- EN_ALIGN_RTL_EC
Sent when the user has changed the edit control direction to right-to-left. The parent window of the edit control receives this notification message through a WM_COMMAND message.
- EN_CHANGE
Sent when the user has taken an action that may have altered text in an edit control. Unlike the EN_UPDATE notification message, this notification message is sent after the system updates the screen. The parent window of the edit control receives this notification message through a WM_COMMAND message.
- EN_ERRSPACE
Sent when an edit control cannot allocate enough memory to meet a specific request. The parent window of the edit control receives this notification message through a WM_COMMAND message.
- EN_HSCROLL
Sent when the user clicks an edit control's horizontal scroll bar. The parent window of the edit control receives this notification message through a WM_COMMAND message. The parent window is notified before the screen is updated.
- EN_KILLFOCUS
The EN_KILLFOCUS notification message is sent when an edit control loses the keyboard focus. The parent window of the edit control receives this notification message through a WM_COMMAND message.
- EN_MAXTEXT
Sent when the current text insertion has exceeded the specified number of characters for the edit control. The text insertion has been truncated.
This message is also sent when an edit control does not have the ES_AUTOHSCROLL style and the number of characters to be inserted would exceed the width of the edit control.
This message is also sent when an edit control does not have the ES_AUTOVSCROLL style and the total number of lines resulting from a text insertion would exceed the height of the edit control.
The parent window of the edit control receives this notification message through a WM_COMMAND message.
- EN_SETFOCUS
Sent when an edit control receives the keyboard focus. The parent window of the edit control receives this notification message through a WM_COMMAND message.
- EN_UPDATE
Sent when an edit control is about to redraw itself. This notification message is sent after the control has formatted the text, but before it displays the text. This makes it possible to resize the edit control window, if necessary. The parent window of the edit control receives this notification message through a WM_COMMAND message.
- EN_VSCROLL
Sent when the user clicks an edit control's vertical scroll bar or when the user scrolls the mouse wheel over the edit control. The parent window of the edit control receives this notification message through a WM_COMMAND message. The parent window is notified before the screen is updated.
- WM_CTLCOLOREDIT Notification
An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control.
Toolbar
Here is the notification information for the MSDN toolbar control.
MSDN Notifications Value
------------------ -----
%WM_NOTIFY
%NM_CHAR
%NM_CLICK
%NM_CUSTOMDRAW
%NM_DBLCLK
%NM_KEYDOWN
%NM_LDOWN
%NM_RCLICK
%NM_RDBLCLK
%NM_RELEASEDCAPTURE
%NM_TOOLTIPSCREATED
%TBN_BEGINADJUST
%TBN_BEGINDRAG
%TBN_CUSTHELP
%TBN_DELETINGBUTTON
%TBN_DRAGOUT
%TBN_DRAGOVER
%TBN_DROPDOWN
%TBN_DUPACCELERATOR
%TBN_ENDADJUST
%TBN_ENDDRAG
%TBN_GETBUTTONINFO
%TBN_GETDISPINFO
%TBN_GETINFOTIP
%TBN_GETOBJECT
%TBN_HOTITEMCHANGE
%TBN_INITCUSTOMIZE
%TBN_MAPACCELERATOR
%TBN_QUERYDELETE
%TBN_QUERYINSERT
%TBN_RESET
%TBN_RESTORE
%TBN_SAVE
%TBN_TOOLBARCHANGE
%TBN_WRAPACCELERATOR
%TBN_WRAPHOTITEM
Toolbar Notification Definitions (from MSDN)
TreeView
Here is the notification information for the MSDN treeview control.
MSDN Notifications Value
------------------ -----
%WM_NOTIFY
%NM_CLICK
%NM_CUSTOMDRAW
%NM_DBLCLK
%NM_KILLFOCUS
%NM_RCLICK
%NM_RDBLCLK
%NM_RETURN
%NM_SETCURSOR
%NM_SETFOCUS
%TVN_ASYNCDRAW
%TVN_BEGINDRAG
%TVN_BEGINLABELEDIT
%TVN_BEGINRDRAG
%TVN_DELETEITEM
%TVN_ENDLABELEDIT
%TVN_GETDISPINFO
%TVN_GETINFOTIP
%TVN_ITEMCHANGED
%TVN_ITEMCHANGING
%TVN_ITEMEXPANDED
%TVN_ITEMEXPANDING
%TVN_KEYDOWN
%TVN_SELCHANGED
%TVN_SELCHANGING
%TVN_SETDISPINFO
%TVN_SINGLEEXPAND
TreeView Notification Definitions (from MSDN)
If you have any suggestions or corrections, please let me know.