Macro Macro3682
Trigger !v"" "#32768" /EXPLORER
Trigger !v"" "#32768" /EXPLORER

int shellMenu=TriggerWindow
ARRAY(int) a; win("" "#32768" "explorer" 0 0 0 a); if(a.len!=1) ret
SetTimer(0 0 100 &sub._Timer)
int hh=SetWindowsHookEx(WH_CBT &sub._Hook 0 GetCurrentThreadId)
;
_s=
;1 Test 1
;> Test
;3 Test 3
;4 Test 4
;<
;5 Test 5
;6 Test 6
;7 Test 7
;8 Test 8
;9 Test 9
_i=ShowMenu(_s 0 0 0 8)
UnhookWindowsHookEx hh
out _i
#sub _Timer v
function u1 u2 timer u3
if !IsWindowVisible(a[0]) && !(RealGetKeyState(1) or RealGetKeyState(2))
,KillTimer 0 timer
,EndMenu
#sub _Hook v
function# nCode w CBT_CREATEWND&m
if nCode=HCBT_CREATEWND
,_i=m.lpcs.lpszClass
,if _i=32768
,,SetTimer(w 5497 1 &sub._Timer2)
ret CallNextHookEx(0 nCode w &m)
#sub _Timer2 v
function myMenu u2 timer u3
KillTimer myMenu timer
RECT rShell rMy
GetWindowRect shellMenu &rShell
GetWindowRect myMenu &rMy
;calculate myMenu position and move
POINT p; xm p
SIZE z; z.cx=rMy.right-rMy.left; z.cy=rMy.bottom-rMy.top
dll user32 #CalculatePopupWindowPosition POINT*anchorPoint SIZE*windowSize flags RECT*excludeRect RECT*popupWindowPosition
CalculatePopupWindowPosition &p &z TPM_RIGHTALIGN &rShell &rMy
mov rMy.left rMy.top myMenu