Geethu Posted April 17, 2014 Share Posted April 17, 2014 Hi, I'm trying to get the status of checkbox(whether it is checked or not). I tried using ControlCommand, If ControlCommand($winHandle, "Accounts", "3278388", "IsChecked", "[NAME:Accounts]") = 0 Then MsgBox(0, "", "not checked") But it's not working for me. Control informations are: Class : WindowsForms10.BUTTON.app.0.31d2b0c_r75_ad2 Instance : 7 ClassnameNN : WindowsForms10.BUTTON.app.0.31d2b0c_r75_ad27 Name : Accounts Advanced Mode : [NAME:Accounts] ID : 3278388 Text : Accounts Position : 15, 112 Size : 83, 19 ControlClick Coords : 46, 14 Handle : 0x00320634 And I displayed the status of the checkbox but it always shows 0(even it is already checked). so the message box always shows "not checked". Could you please help me to find a solution for this problem? Link to comment Share on other sites More sharing options...
AdamUL Posted April 18, 2014 Share Posted April 18, 2014 Your ControlCommand for IsChecked is called incorrectly. The option parameter is an empty string with this command. Also, if you are using the window handle, then you do not need the "text" parameter. Try this. If ControlCommand($winHandle, "", 3278388, "IsChecked", "") = 0 Then MsgBox(0, "", "not checked") Adam Link to comment Share on other sites More sharing options...
Geethu Posted April 21, 2014 Author Share Posted April 21, 2014 Thank you Adam for your response. I tried your suggestion, but its not working for me. Link to comment Share on other sites More sharing options...
LarsJ Posted April 21, 2014 Share Posted April 21, 2014 This can be done with the UI Automation framework.Download the two UDFs in bottom of first post, and download and run the code in the "Simple spy demo" codebox in the middle of first post.To verify that a control can be identified place the mouse cursor over the control and press Ctrl+w. You can see an example here.Note that the framework is based on COM interface objects (created with ObjCreateInterface), so it's not just as easy to use as most built-in commands. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
jdelaney Posted April 21, 2014 Share Posted April 21, 2014 Use the NAME to get the control...the other stuff will change each time you start the application. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Geethu Posted April 23, 2014 Author Share Posted April 23, 2014 (edited) Thank you all for your responses. The problem solved using; ControlClick($winHandle, "", "[NAME:Accounts]") and checking the return value. Edited April 23, 2014 by Geethu 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