popup menu

myilmaz

New Member
I have treeview (mscomctl.ocx) menu and popup menu on smart window to ver 82.b.
ı want open a popup menu when mouse-right click on treeview menu .
how apply command in mousedown event.
 
myilmaz said:
I have treeview (mscomctl.ocx) menu and popup menu on smart window to ver 82.b.
ı want open a popup menu when mouse-right click on treeview menu .
how apply command in mousedown event.

You attach the popup menu to the control frame in the normal way. For OCX's, you must invoke the popup-menu manually by getting MS-Windows to send the OCX a message. The best place that I've found to do this is in the MENU-DROP trigger itself:

ON "MENU-DROP" OF MENU p_Edit
DO:
RUN SendMessageA (hHandle:hWnd, 517, 0, 0).
END.

To make the menu appear, you just say APPLY "MENU-DROP" to mymenu.

The SendMessageA is a MS-Windows API method that you can define in your program like this:

PROCEDURE SendMessageA EXTERNAL "USER32.DLL":
DEFINE INPUT PARAMETER win-handle AS LONG NO-UNDO.
DEFINE INPUT PARAMETER win-msg AS LONG NO-UNDO.
DEFINE INPUT PARAMETER win-param1 AS LONG NO-UNDO.
DEFINE INPUT PARAMETER win-param2 AS LONG NO-UNDO.
END PROCEDURE.

I know that this works okay at v9, but 8.2 I'm not sure about.


 
Back
Top