This example processes an application-defined message (IDM_SHOW) and sets a check mark next to the selected item.

#define INCL_WIN
#define INCL_WINDIALOGS
#include <OS2.H>
#define IDM_SHOW 902

HWND hwndFrame;
ULONG  msg;
MPARAM mp1;

/* Inside client procedure. */

switch(msg)
{
 case WM_COMMAND:
 /* The user has chosen a menu item.  Process the selection */
 /* accordingly.                                            */

  switch ( SHORT1FROMMP( mp1 ) )
   {

    case IDM_SHOW:
            WinSendDlgItemMsg(hwndFrame,  (ULONG) FID_MENU,
                     (ULONG) MM_SETITEMATTR,
                    MPFROM2SHORT(IDM_SHOW, TRUE),
                    MPFROM2SHORT(MIA_CHECKED,MIA_CHECKED));
    break;

   }
 break;
}


[Back] [Next]