The custom menu is displayed next to the system shell menu.
When the F11 hotkey is pressed or the right mouse button is pressed,
I need to obtain the ID of the menu item under the mouse cursor so that I can output the text of the menu item.
Function Menu_Edit
Trigger !v"" "#32768" /QM
Macro Macro51
Trigger !v"" "#32768" /EXPLORER
When the F11 hotkey is pressed or the right mouse button is pressed,
I need to obtain the ID of the menu item under the mouse cursor so that I can output the text of the menu item.
Function Menu_Edit
Trigger !v"" "#32768" /QM

out
int h=TriggerWindow
;if(MenuGetString(hwnd 1 &_s)) out _s ;;Why is there no output?
rep
,0.1
,ifk(F11)
,,int mh=win(mouse); out mh
,,int iid=1 ;;How to get the ID of the menu item under the mouse cursor?
,,Acc a.Find(h "MENUITEM" "" "" 0x1001 3 iid)
,,out a.Name
,,key Z ;; Esc
,,breakMacro Macro51
Trigger !v"" "#32768" /EXPLORER

int hwnd=TriggerWindow
ARRAY(int) a; win("" "#32768" "explorer" 0 0 0 a); if(a.len>1) ret
SetTimer(0 0 100 &sub._Timer)
;
_s=
;1 open docx
;2 open other
_i=ShowMenu(_s 0 0 0 8)
out _i
#sub _Timer v
function u1 u2 timer u3
if !IsWindowVisible(a[0]) && !(RealGetKeyState(1) or RealGetKeyState(2))
,KillTimer 0 timer
,EndMenu