Posts: 795
Threads: 136
Joined: Feb 2009
Hi Gintaras,
is it possible after x.showmenu (or x.show) to determine which mouse key did select an item?
Posts: 12,051
Threads: 140
Joined: Dec 2002
Want to select with right button? With QM menu functions can only with left button.
EDIT: Also can with right button, use tpmFlags TPM_RIGHTBUTTON. But cannot know then.
Posts: 795
Threads: 136
Joined: Feb 2009
Ok, as windows allows both.
Thanks anyway.
A thought: would it work just after the menu is shown to wait for a right mouse click, get the menu item under cursor and get the item value ?
What I want to do is send menuitem value to a window by left click, or copy to clipboard menutiem value by right click.
Can we cheat like that?
Posts: 12,051
Threads: 140
Joined: Dec 2002
The menu must have an owner window, for example a hidden dialog. On right-click the dialog procedure will receive message WM_MENURBUTTONUP.
I added this code to drag_drop_text_menu_manager, now on right-click it shows another menu.
Posts: 795
Threads: 136
Joined: Feb 2009
Cool, I just tweaked the code to be able to directly copy to clipboard on right click,
in fact added the same code to autoclose menu on paste in clipboard (right click) from left click.
Function
drag_drop_text_menu_manager
;gRight
i=DDTM_GetItem(lParam wParam t_csv); if(i<0) ret
_s=DDTM_GetItemText(t_csv i); _s.setclip
w=child(mouse 1)
act w; err
xm p w 1
xy=p.y<<16|p.x
SendMessage w WM_LBUTTONDOWN MK_LBUTTON xy
SendMessage w WM_LBUTTONUP 0 xy
Posts: 12,051
Threads: 140
Joined: Dec 2002
To close menu - function EndMenu.
Posts: 795
Threads: 136
Joined: Feb 2009