| || |
The people on this forum seem to be pretty helpful, so I thought Id give it a shot!
I am trying to right click on a tree in a MMC snapin and select something from the popup menu.
The method I am currently using to do this is:
[ ] RECT rSel = Window.AfxFrameOrView42u1.TheTree.GetItemRect("/some/path")
[ ] Agent.SetOption (OPT_MENU_INVOKE_POPUP, "<Button2><Up><Down>")
[ ] Window.AfxFrameOrView42u1.TheTree.PopupSelect(rSel .xPos+4, rSel.yPos+4, "Popupmenu Item")
I alway get the error message:
*** Error: Window 'Popupmenu Item' was not found
Has any one else had success with this method, or know what I am doing wrong?
[This message has been edited by eytan (edited 11-09-2000).]
Re: PopupSelect problems
i had this same problem. i had to write a custom PopupInvoke at the level of the Tree, passing in the x,y coordinates of the selected TreeView item. Once i had gotten the popup menu up i used the Pick() method on the MenuItem. Here is the code snippet for the PopupInvoke:
[-] PopupInvoke (INTEGER x, INTEGER y)
[ ] Menu
Hope this helps.