pseakins Posted September 28, 2007 Share Posted September 28, 2007 I'm porting some MacroScheduler hotkey routines into AutoIt. Currently stumped finding an equivalent to MSC's "GetCheckBox". I have found AU3's "GuiCtrlRead" but, as I read it, I think it is used to access controls that have been created by the script. I say this because the controls seem to be referenced using "controlID" which is generated when GUICtrlCreate builds a form. I'm looking to access and change controls in an existing application. Am I reading this wrongly? Basically, I need to run an application, open its "settings" panel and then set or clear various checkboxes on the form. I would appreciate anyone pointing me to some example AU3 code which does this or something similar. Thanks in advance. Phil Seakins Link to comment Share on other sites More sharing options...
sandin Posted September 28, 2007 Share Posted September 28, 2007 will this help? #include <GUIConstants.au3> Opt("GUIOnEventMode", True) $gui = GUICreate("title", 200, 200) $Checkbox = GUICtrlCreateCheckbox("text", 10, 10) $button = GUICtrlCreateButton("Change checkbox", 10, 100) GUISetOnEvent($GUI_EVENT_CLOSE, "_exit") GUICtrlSetOnEvent($button, "_change") GUISetState() func _change () ;for reading state: if GUICtrlRead($Checkbox) = $GUI_CHECKED Then ;for unchecking: GuiCtrlSetState($Checkbox, $GUI_UNCHECKED) Else ;for checking: GuiCtrlSetState($Checkbox, $GUI_CHECKED) EndIf EndFunc func _exit () Exit EndFunc While 1 Sleep(10) WEnd Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
pseakins Posted September 28, 2007 Author Share Posted September 28, 2007 (edited) will this help?Thanks for the code, but no, this will not help. I am looking to access controls in an existing application, NOT in a gui created within the AU3 script itself.I think the answer might lie with ControlCommand but I haven't nutted out how yet. Edited September 28, 2007 by pseakins Phil Seakins Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 28, 2007 Share Posted September 28, 2007 Thanks for the code, but no, this will not help. I am looking to access controls in an existing application, NOT in a gui created within the AU3 script itself.I think the answer might lie with ControlCommand but I haven't nutted out how yet.Look in the help file at the commands you can apply with ControlCommand(). Specifically Check and UnCheck to perform the action, and IsChecked to see status. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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