mraymond Posted December 17, 2007 Share Posted December 17, 2007 I've been trying for a while to get the state of a check box in an existing application. Finally found the GUICtrlRead function but have not been able to figure out the right way to use it. I've tried examples of other peoples work here in the forums, but no matter what I do, it always returns a zero. This returns a zero whether I have the box checked or unchecked, so I know it's not giving me the correct information. Below is the code, and then the autoit control viewer information. ; ------------------------------------------------------------------------------------------------- ; Verify the Application Preference Startup File: check box is defaulted as unchecked ; ------------------------------------------------------------------------------------------------- _FileWriteLog( "Script_Log.txt", "--------------------------------------------------------------------------------------------------" ) _FileWriteLog( "Script_Log.txt", "-- Verifying Application Preferences Startup File: check box is defaulted as unchecked" ) _FileWriteLog( "Script_Log.txt", "--------------------------------------------------------------------------------------------------" ) ControlFocus("Application Preferences", "", "Button32") $state = GUICtrlRead ( "[CLASS:Button, Instance 32]" ) _FileWriteLog( "Script_Log.txt", $state ) --------------- viewer information Class Button Instance 32 ClassnameNN Button32 ID 2363 Text &Startup File: Positioin 20, 10 Size 99, 16 ControlClick Coords 8, 8 Style 0x50010003 ExStyle 0x00000004 Handle 0x006204D6 Link to comment Share on other sites More sharing options...
GaryFrost Posted December 17, 2007 Share Posted December 17, 2007 ControlCommand SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
mraymond Posted December 18, 2007 Author Share Posted December 18, 2007 ControlCommand Cool! That was easy. It worked. Below is the code I used to fix it. Thank you... that was great! ControlFocus("Application Preferences", "", "Button32") $State = ControlCommand ( "Application Preferences", "&Startup File:", "[CLASSNN:Button32]", "IsChecked", "" ) _FileWriteLog( "Script_Log.txt", $state ) 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