Jump to content

seeing if a checkbox is marked or not


 Share

Recommended Posts

I need to see if a checkbox is marked or not. I can't seem to find the function to do this. The closest I found were GUICtrlGetState and GUICtrlRead, but the documentation says they can only accept a controlID that was returned by a GUICtrlCreate... function ie. one that I made myself. I need to look at a markbox in the program that I'm trying to automate. I tried used those functions anyway, but couldn't get them to work. So how is this supposed to be done? I feel really dumb that I can't figure out such a basic task.

Link to comment
Share on other sites

If the checkbox already exists, you won't be able to get the state using the ctrlread function. What about pixelsearch to find the color black in the box?

This is kind of a bad reply, as I answered before I realized it wasn't the GUI you created.

Edited by mikjay
Link to comment
Share on other sites

I need to see if a checkbox is marked or not. I can't seem to find the function to do this. The closest I found were GUICtrlGetState and GUICtrlRead, but the documentation says they can only accept a controlID that was returned by a GUICtrlCreate... function ie. one that I made myself. I need to look at a markbox in the program that I'm trying to automate. I tried used those functions anyway, but couldn't get them to work. So how is this supposed to be done? I feel really dumb that I can't figure out such a basic task.

Get the control ID of the checkbox using the AutoIt Window Info tool (AU3Info.exe). Then you can use:
$IsChecked = ControlCommand("Window Title", "", $idChkBox, "IsChecked") ; Where $idChkBox is the control ID

:)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...