Sign in to follow this  
Followers 0
Geethu

How to get the status of Non AutoitGUI Checkbox

6 posts in this topic

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?

 

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

Thank you Adam for your response.

I tried your suggestion, but its not working for me. :(

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Thank you all for your responses.

The problem solved using; ControlClick($winHandle, "", "[NAME:Accounts]") and checking the return value. :)

Edited by Geethu

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0