windows_programming_notes.nbk: Home | Index | Next Page: message-only window | Previous Page: MapDialogRect


 message crackers

The HANDLE_MSG macro in the WINDOWSX.H header file allows you to build the switch statement message dispatcher easily:

    switch(msg) {
    HANDLE_MSG(hwnd, WM_COMMAND, On_Command);
    ...
    }

Where:

A call to the message cracker macro is nested inside HANDLE_MSG. The message cracker extracts the message parameters from the lParam and wParam arguments and casts them to the proper types. You need to know the function signature for the function to be called to handle each message.


windows_programming_notes.nbk: Home | Index | Next Page: message-only window | Previous Page: MapDialogRect


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time