taurus905 Posted July 7, 2006 Share Posted July 7, 2006 Is it possible to right-click on a button inside a gui and get it to change focus to that button? I am using the following: GUISetOnEvent($GUI_EVENT_SECONDARYDOWN, "_sys_event_handler", $gui) But I am not sure how to detect which button is being right-clicked on. Thanks, taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 7, 2006 Moderators Share Posted July 7, 2006 #include <guiconstants.au3> Opt('GUIOnEventMode', 1) Global $BUTTON[6] $MAIN_GUI = GUICreate('TEST', 270, 50) For $i_Count = 1 To UBound($BUTTON) - 1 $BUTTON[$i_Count] = GUICtrlCreateButton('Button ' & $i_Count, 10 + (($i_Count - 1) * 50), 10, 50, 30) Next GUISetOnEvent($GUI_EVENT_SECONDARYDOWN, "_sys_event_handler", $MAIN_GUI) GUISetOnEvent(-3, "_Exit", $MAIN_GUI) GUISetState() While 1 Sleep(10000) WEnd Func _sys_event_handler() Local $GetCursor = GUIGetCursorInfo($MAIN_GUI) ControlFocus($MAIN_GUI, '', $GetCursor[4]) EndFunc Func _Exit() Exit EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
taurus905 Posted July 7, 2006 Author Share Posted July 7, 2006 SmOke_N, Thank you sir. GUIGetCursorInfo was exactly what I needed. taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now