A SERVICE OF

logo

EV_CHILD_NOTIFY_ALL_CODES(ID_LISTBOX, HandleListBoxMsg)
void HandleListBoxMsg(UINT);
ObjectWindows 2.0 also supports dispatching specific notification codes to
specific member functions, something ObjectWindows 1.0 doesn’t support.
Use the EV_CHILD_NOTIFY event response table entry for such
dispatching. Here’ an example:s
EV_CHILD_NOTIFY(ID_BUTTON, HandleButtonClick, BN_CLICKED)
void HandleButtonClick();
Since you often need to respond to Windows control notification codes,
ObjectWindows defines macros to more easily handle button, combo box,
edit control, and list box notification codes. Here’ an example thats
simplifies the LBN_DBLCLK notification code:
EV_LBN_DBLCLK(ID_LISTBOX, HandleListBoxMsg)
void HandleListBoxMsg(UINT);
Child ID-based messages are actually command messages that include a
notification code. For command buttons, the notification code is zero,
which makes it look like a menu command message. The recommended
way of responding to button presses is with command message response
functions rather than child ID-based message response functions. For
example, an OK button is usually a child window to a dialog box. When the
user clicks it, the button passes a message that can be handled like a
command message. Y u can handle the button message like this:o
EV_COMMAND(IDOK, CmOk)
Responding to notification messages
Notification messages are like child ID-based messages but instead of being
handled by the parent window they’re handled by the control itself.,
Notification messages are best for creating specialized control classes.
ObjectWindows 1.0 and 2.0 both dispatch notification messages to specific
member functions, as this example shows:
// ObjectWindows 1.0 member function declaration
virtual void ENChange(TMessage &Msg) = [NF_FIRST + EN_CHANGE]
// ObjectWindows 2.0 event response table entry and function definition
EV_NOTIFY_AT_CHILD(EN_CHANGE, ENChange)
void FNameChange();
366
OWL P ogrammer’ Guider s