I am trying to find a way to check if the context menu exists, or wait for the context menu to appear in Microsoft Edge.
I found this v1 script, but it doesnot seem to work. So I didnot modify it to v2.
(Um, actually I did modify it to v2, but I'm not sure about the usage of NumPut and DllCall. Anyway, it doesn't really matter, neither of them works .)
Code: Select all
; https://www.autohotkey.com/board/topic/85769-how-to-detect-existence-of-a-right-click-menuin-any-app/#entry546326
#Requires AutoHotkey v1.1
; based on closeContextMenu() by Stefaan - http://www.autohotkey.com/community/viewtopic.php?p=163183#p163183
DetectContextMenu()
{
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)
{
return 1 ; we've found a context menu
}
else
{
return 0
}
}
I know that ahk_class #32768 can be used to check the context menu in "explorer".
Is there a way to check context menu in Microsoft Edge or other programs?