Jump to content

Checking for Selected Windows Radio Button


Recommended Posts

Hi all,

Once again, I need some help.

I'm trying to determine if a checkbox is selected (in a program that is not created by me or in AutoIT.)

Since it's not an AutoIT program, I can't use GUICtrlRead. So I used ControlCommand instead.  However, while the commands "Check" or "Uncheck" work, the "IsChecked" command produces nothing.  Am I missing something?

The program is a simple window with one button.  When the button is pressed, my program reads from another program that has 10 radio button options.   It writes to the console the radio button text and 1 or 0 depending on if the radio button is checked or not.    The text is displayed, but the IsChecked command only returns 0s.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 514, 264, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 72, 56, 361, 129)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

        Case $Button1
            For $x = 1 to 10
                 ConsoleWrite(ControlGetText("Windows Program Name","","[CLASS:TRzGroupButton; INSTANCE:" & $x & "]")& @CRLF)
                 ConsoleWrite(ControlCommand("Windows Program Name","","[CLASS:TRzGroupButton; INSTANCE:" & $x & "]", "IsChecked", "") & @CRLF)
            Next

        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

 

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...