Prasanna Posted September 12, 2007 Share Posted September 12, 2007 Hi guys, I'm new to autoit. I've tried to trace a checkbox state using the "IsChecked" option but it results as unchecked even if the check box is in checked state. the code what i'm using is, if(ControlCommand("Main","Main","[ClassNN:WindowsForms10.BUTTON.app332]","IsChecked", "")==0) Then MsgBox(0,"","Not Checked") Else MsgBox(0,"","Checked") EndIf So anybody can help me with this. Thanks in advance. Link to comment Share on other sites More sharing options...
andrei0x309 Posted September 12, 2007 Share Posted September 12, 2007 The comparation operator in a if condition is = not == like in c++ , php .. etc .. Link to comment Share on other sites More sharing options...
herewasplato Posted September 13, 2007 Share Posted September 13, 2007 (edited) Prasanna,Welcome to the forum!The help file saysNote: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!This code works as expected for me:Run("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1") WinWaitActive("Display Properties", "Screen Saver") If ControlCommand("Display", "", "Button4", "IsChecked", "") = 0 Then MsgBox(0, "", "not checked") Else MsgBox(0, "", "checked") EndIfThe help file also says that you can use "==" as an operator in a If/Then/Else/EndIf line:RemarksIf statements may be nested.The expression can contain the boolean operators of AND, OR, and NOT as well as the logical operators <, <=, >, >=, =, ==, and <> grouped with parentheses as needed....but, you may not want to do that in this type of comparison...The "IsChecked" ControlCommand returns a number.I think that the "==" is for string compares, but you can figure out how AutoIt handles "=" and "==" in this thread - maybe:http://www.autoitscript.com/forum/index.ph...showtopic=47388As for this part of your code"[ClassNN:WindowsForms10.BUTTON.app332]"Please open the AutoIt Window Info toolClick on the control of interestPress Ctrl-Alt-F to freeze the data in the AutoIt Window Info toolthen copy/paste/post the info from the "Summary tab" of that tool for the Control Section - like this:>>>> Control <<<<Class: SysListView32Instance: 1ClassnameNN: SysListView321-MSP- Edited September 13, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
maets Posted September 14, 2007 Share Posted September 14, 2007 Hi, I have the same problem. When I tested my script on a windows built-in application it worked however... guess this goes under: "AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation." Link to comment Share on other sites More sharing options...
Prasanna Posted September 26, 2007 Author Share Posted September 26, 2007 Hi, I have the same problem.When I tested my script on a windows built-in application it worked however...guess this goes under: "AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation."Thanks For the Response, I've written my dll call function in autoit for checkbox and combo boxes its wotking fine right now. 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