Jump to content

Check if Error reporting windows radio are checked


Recommended Posts

I'm writing a script for my company and one of the functions is to open the error reporting window in system properties and make sure one the options is checked. The issue is I can not find the right command to check if button one is checked or if button to is checked so i can write an if then to tell it if button one is check alt o to ok out. I would write a macro to do it but the problem is we deal with so many varied screen sizes that this would be a much larger issue then just saying to check for button one or button 2 in error reporting window.

Link to comment
Share on other sites

I'm writing a script for my company and one of the functions is to open the error reporting window in system properties and make sure one the options is checked. The issue is I can not find the right command to check if button one is checked or if button to is checked so i can write an if then to tell it if button one is check alt o to ok out. I would write a macro to do it but the problem is we deal with so many varied screen sizes that this would be a much larger issue then just saying to check for button one or button 2 in error reporting window.

You kept referring to buttons, but I believe you meant checkboxes. If so, you need to define your checkboxes as variables, and then use GuiCtrlRead to find out if they are checked or not:

;Create Checkbox1
$checkbox1 = GUICtrlCreateCheckbox ("CHECKBOX 1", 10, 10, 120, 20)

;Find out if Checkbox is checked
If GuiCtrlRead($checkbox1) = $GUI_CHECKED Then
    MsgBox(0,"","Checkbox 1 is checked!")
EndIf
Edited by Airwolf123
Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt
Link to comment
Share on other sites

You kept referring to buttons, but I believe you meant checkboxes. If so, you need to define your checkboxes as variables, and then use GuiCtrlRead to find out if they are checked or not:

;Create Checkbox1
$checkbox1 = GUICtrlCreateCheckbox ("CHECKBOX 1", 10, 10, 120, 20)

;Find out if Checkbox is checked
If GuiCtrlRead($checkbox1) = $GUI_CHECKED Then
    MsgBox(0,"","Checkbox 1 is checked!")
EndIf
No this is in the sysdm.cpl control panel and they show as buttons in the autoit window info as button one and button to I just need to knwo how to have auto it if possible check and see if button 1 is check or if button to is checked so I can tell it then if button one is checked go to ok if button 2 is check change to button one and then hit ok.
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...