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.
In VFP, you have to assign the hWnd property of the form to the Notifier property of the control as follows:
contextMenu.Notifier = thisform.HWnd
while the following code:
BINDEVENT( thisform.HWnd, 273, thisform, "oncommand" )
adds a handler oncommand for the WM_COMMAND message ( 273 or 0x111 in hexa, is the identifier of the WM_COMMAND message ).
The oncommand may look like:
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