See that confuses me though, because wouldn't those downs be sent to the remote window. Or perhaps that changes when the menu gets the focus.
Acc and accDoDefaultAction can be useful for invoking menu items.
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
[EDIT:] Btw you may be able to press a letter to invoke a menu item (hold alt to see underlines), and you could do {Down 6}.
[EDIT:] Examples of some alt+space menu/regular menu items in Internet Explorer being invoked via PostMessage:
Code: Select all
PostMessage, 0x111, 41511,, TabWindowClass1, A ;WM_COMMAND := 0x111 ;Menu bar
PostMessage, 0x111, 41474,, TabWindowClass1, A ;WM_COMMAND := 0x111 ;Status bar
PostMessage, 0x111, 41484,, TabWindowClass1, A ;WM_COMMAND := 0x111 ;Lock the toolbars
PostMessage, 0x80F0, 42455,,, A ;WM_APP+240 := 0x80F0 ;Show tabs on a separate row
PostMessage, 0x111, 3460,, TabWindowClass1, A ;WM_COMMAND := 0x111 ;Caret browsing
Obtained via HotkeyP, mentioned here:
best utilities + best AutoHotkey scripts (+ useful tips) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=28149
[EDIT:] Internet Explorer is a bit unusual, normally you can invoke sysmenu items by doing this:
PostMessage, 0x112, % vID,,, A ;WM_SYSCOMMAND := 0x112
And normal menu items by doing this:
PostMessage, 0x111, % vID,,, A ;WM_COMMAND := 0x111
This can be useful for getting WM_COMMAND/WM_SYSCOMMAND IDs from menus:
Get Info from Context Menu (x64/x32 compatible) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=31971
[EDIT:] A way to show the sysmenu without sending clicks, and how to invoke standard sysmenu items:
Code: Select all
;show menus
PostMessage, 0x112, 0xF100, 0x20,, A ;WM_SYSCOMMAND := 0x112 ;SC_KEYMENU := 0xF100 ;show sysmenu
PostMessage, 0x112, 0xF100, 0x46,, A ;WM_SYSCOMMAND := 0x112 ;SC_KEYMENU := 0xF100 ;show f menu (e.g. File)
PostMessage, 0x112, 0xF100, 0x45,, A ;WM_SYSCOMMAND := 0x112 ;SC_KEYMENU := 0xF100 ;show e menu (e.g. Edit)
;invoke sysmenu items
PostMessage, 0x112, 0xF120,,, A ;WM_SYSCOMMAND := 0x112 ;SC_RESTORE := 0xF120
PostMessage, 0x112, 0xF010,,, A ;WM_SYSCOMMAND := 0x112 ;SC_MOVE := 0xF010
PostMessage, 0x112, 0xF000,,, A ;WM_SYSCOMMAND := 0x112 ;SC_SIZE := 0xF000
PostMessage, 0x112, 0xF020,,, A ;WM_SYSCOMMAND := 0x112 ;SC_MINIMIZE := 0xF020
PostMessage, 0x112, 0xF030,,, A ;WM_SYSCOMMAND := 0x112 ;SC_MAXIMIZE := 0xF030
PostMessage, 0x112, 0xF060,,, A ;WM_SYSCOMMAND := 0x112 ;SC_CLOSE := 0xF060