property ExContextMenu.Notifier as Long
Retrieves or sets the handle of the window that receives notifications/WM_COMMAND messages.

 TypeDescription 
   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.   
By default, the Notifier property is 0, which indicates that the property has no effect. Set the Notifier property to a window that you want to receive notification of the control through the WM_COMMAND message. For instance, in VFP or C++ it would be easier to handle the events of the control using the WM_COMMAND messages, rather than using sink interfaces. 

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

 


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.