Sign in to follow this  
Followers 0
WestCBear

Checking for Selected Windows Radio Button

4 posts in this topic

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

 

Share this post


Link to post
Share on other sites



Try

ConsoleWrite(ControlCommand("Windows Program Name","","[CLASS:TRzGroupButton; INSTANCE:" & $x & "]", "IsChecked") & @CRLF)

as the option-param is optional and not needed.

Share this post


Link to post
Share on other sites

Hi AutoBert,

Thanks for the prompt reply.  I already tried that with the same negative result.  Any other ideas?  :)

Cheers,

WestCBear

Share this post


Link to post
Share on other sites

Is the app a free software or has a trial version? If so please post the downloadlink, so others and i can try.

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