Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

WM_INITMENU & WM_INITMENUPOPUP msgs not monitored


  • Please log in to reply
1 reply to this topic
Hardeep
  • Members
  • 87 posts
  • Last active: Sep 12 2007 06:40 PM
  • Joined: 02 Jul 2006
WM_INITMENU & WM_INITMENUPOPUP messages are not being processed by the functions set using OnMessage().
In the following code when you try to view the system menu, Windows Spy shows the messages being sent. Is AHK handling them internally?

Gui,Show, w100 h100
OnMessage(0x116,"ProcessMSG")	;WM_INITMENU
OnMessage(0x117,"ProcessMSG")	;WM_INITMENUPOPUP

ProcessMSG(wParam,iParam,Msg,HWND)
{
	MsgBox,,ProcessMSG, Msg=%Msg%
}


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Chances are, the messages for the system (icon) menu are being sent to some other window than the GUI window (perhaps some system/child window), assuming they are being sent at all. AutoHotkey contains no special handling for WM_INITMENU/WM_INITMENUPOPUP anywhere, so I can't think of any reason you wouldn't be able to monitor them.

Perhaps if you created a menu bar for the GUI window, the act of accessing the menu bar would produce a message that could be monitored via OnMessage.