svi, you are a genius. What you suggested works perfectly:
svi wrote:
WinGet,ControlHwnd, ID,ahk_class #32768
But now I am puzzled: Winspector Spy says that both the main context
menu and its submenu have the same class name #32768.
So, how does WinGet know to get the hWnd of the submenu instead of the main menu?
To further explain my question: If I follow WinGet by the following statement:
Code:
ContextMenCnt := GetContextMenuCount(hWnd)
Then I get the correct number of menu items in the submenu - if the submenu is open. And I get the correct number of menu items in the main menu - if the submenu is not open.
Obviously, I don't understand how this works. Can you (or anyone) explain?
Thx!