
| Type | Description | |||
| Long | A Long expression that specifies the handle of the window that receives the WM_COMMAND when the user selects, check/uncheck, edit an item. |
The wParam parameter of the WM_COMMAND message carries the identifier of the event which occurred like listed bellow:
The lParam parameter of the WM_COMMAND message carries the identifier of the item who fired the event. You can use the Item property to access the control's item giving its identifier. The ID property specifies the item's identifier.
The following VFP sample shows how to use the Notifier property to specify that the form receives the WM_COMMAND messages of the control:
contextMenu.Notifier = thisform.HWnd
The following VFP sample shows how to use the BINDEVENT function to bind the WM_COMMAND message (273 or 0x111 in hexa, is the identifier of the WM_COMMAND message) to a method of the form:
BINDEVENT( thisform.HWnd, 273, thisform, "oncommand" )
The following VFP sample shows how to implement the oncommand method of the form to handle the WM_COMMAND messages of the control:
LPARAMETERS hWnd, uMsg, wParam, lParam ?wParam *CheckItem IF ( wParam = 1 ) then thisform.contextMenu_CheckItem(lParam) ELSE * UncheckItem IF ( wParam = 2 ) then thisform.contextMenu_UncheckItem(lParam) ENDIF ENDIF