Jump to content

How to get the status of Non AutoitGUI Checkbox


Recommended Posts

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

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...