Jump to content
Sign in to follow this  

[Solved. User error] GUIRegisterMsg() behaves different in AERO mode

Recommended Posts


Edit: User error. Mousetrap() area was in menu bar when using AERO. Show menu is correct in this case.

Running in a non AERO mode, all is OK.
But in AERO mode, the mouseclicks are not recogniced and behave as default. e.g. right click opens menu.
Here a small reproducer of the problem.
Just switch between non-aero and aero mode. Non-aero first to see (hear) the desired result.
#include <GUIConstants.au3>
#include <Misc.au3>
$GUI = GUICreate("Aero Mouse Tester( ESC = Exit )  ", 400, 60)
$LabelId = GUICtrlCreateLabel("right mouseclick please", 10, 10, 380, 180, 1)
GUICtrlSetFont($LabelId, 20)
GUIRegisterMsg($WM_RBUTTONDOWN, "Work")
$coords = WinGetPos($GUI)
_MouseTrap($coords[0] + 200, $coords[1] + 23, $coords[0] + 205, $coords[1] + 25)
$OVoice = ObjCreate("SAPI.SpVoice")
$OVoice.Speak("right mouseclick please")
While 1
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
Func Work($hWndGui, $MsgId, $WParam, $LParam)
EndFunc   ;==>Work

Any idea how to fix this in AERO mode ?
Edit: Changed title from TrackMouseEvent() to GUIRegisterMsg().  Stripped code to minimum

Edited by Exit

My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this