Page 1 of 1

identify if 3rd party window main menu is active?

Posted: 01 Jun 2019, 11:22
by autocart
Hi all,

does someone know if and how it is possible to identify if a 3rd party window main menu is currently active? In effect, whether Alt was pressed and the accelorator characters of the main menu are currently underlined?

Thx and regards

Re: identify if 3rd party window main menu is active?  Topic is solved

Posted: 01 Jun 2019, 19:48
by jeeswg
This should get the process name for any visible standard Windows context menu.

Code: Select all

q:: ;get process name for visible context menu
if !hWnd := WinExist("ahk_class #32768")
{
	MsgBox, % "no context menu found"
	return
}
WinGet, vPName, ProcessName, % "ahk_id " hWnd
MsgBox, % vPName
return
The code here can detect if a menu bar is focused:
detecting menus in mpc-hc - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=55247&p=237141#p237141

Re: identify if 3rd party window main menu is active?

Posted: 02 Jun 2019, 07:10
by autocart
jeeswg wrote:
01 Jun 2019, 19:48
The code here can detect if a menu bar is focused:
detecting menus in mpc-hc - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=55247&p=237141#p237141
This was exactly what I was looking for!
The other part above should also prove helpful.

THANK YOU SOOO MUCH, JEESWG, YOU MAKE THE WORLD A BETTER PLACE AND OTHER PEOPLES LIFES HAPPIER AND MORE WORTH LIVING!!!!
THANK YOU!!!!!!

Re: identify if 3rd party window main menu is active?

Posted: 06 Jul 2019, 10:15
by jeeswg
That's great! :P

Working with menu bars was one of the first times I had to work with DllCall etc from scratch, there wasn't any relevant code on the forum at the time.