; close context menu CTRL+ALT
Send {RCtrl DOWN}{Alt DOWN}{Alt UP}{RCtrl UP}
; detect context menu
closeContextMenu()
{
GuiThreadInfoSize = 48
VarSetCapacity(GuiThreadInfo, 48)
NumPut(GuiThreadInfoSize, GuiThreadInfo, 0)
if not DllCall("GetGUIThreadInfo", uint, 0, str, GuiThreadInfo)
{
MsgBox GetGUIThreadInfo() indicated a failure.
return
}
; GuiThreadInfo contains a DWORD flags at byte 4
; Bit 4 of this flag is set if the thread is in menu mode. GUI_INMENUMODE = 0x4
if (NumGet(GuiThreadInfo, 4) & 0x4)
send {escape}
}