Sign in to follow this  
Followers 0
DanielMeier

Uncheck a checkbox

2 posts in this topic

This is my first day using AutoIt. I'm trying to uncheck a checkbox.

Here's my script so far:

include <StaticConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>

Local $Title = "Campus Portal Install"

Run("C:\Temp\PortalInstall-13_1_A_HF5_0003\cmcportalinstall.exe")
Local $hWnd = WinWaitActive($Title)
Send("z:\CampusPortal\")

Local $cbHnd = ControlGetHandle ( $Title, "", "[NAME:cbBackupIIS]" )
WinActivate( $cbHnd )
Local $CStat = ControlCommand($Title, "", "[NAME:cbBackupIIS]", "IsChecked","")
Local $msgStr = "IsChecked = " & $CStat & "; Form Handle = " & $hWnd & "; Control Handle = " & $cbHnd
MsgBox($MB_SYSTEMMODAL, "Debug", $msgStr, 10)
ControlCommand($hWnd, "", "[NAME:cbBackupIIS]", "UnCheck", "")
ControlCommand($cbHnd, "", "", "UnCheck","")

$msgStr = "@error = " & @error
MsgBox($MB_SYSTEMMODAL, "Title", $msgStr, 10)
WinClose($Title)
Send("{ENTER}")

IsChecked always returns 0 (that's perplexing; the check box is checked when I open up the application; but the online help says that it returns the status of a radio button so maybe that's why I'm not getting anything for a checkbox).

The $cbHnd is different than the $hWnd (that's a good thing).

The checkbox does not appear unchecked in the application before the WinClose.

Also, here is the control information:

>>>> Window <<<<
Title: Campus Portal Install
Class: WindowsForms10.Window.8.app.0.2004eee
Position: 496, 166
Size: 608, 523
Style: 0x16CF0000
ExStyle: 0x00050100
Handle: 0x00450334
 
>>>> Control <<<<
Class: WindowsForms10.BUTTON.app.0.2004eee
Instance: 15
ClassnameNN: WindowsForms10.BUTTON.app.0.2004eee15
Name: cbBackupIIS
Advanced (Class): [NAME:cbBackupIIS]
ID: 1049322
Text: Backup IIS Entries?
Position: 108, 142
Size: 123, 15
ControlClick Coords: 55, 6
Style: 0x5601000B
ExStyle: 0x00000000
Handle: 0x001002EA
 
>>>> Mouse <<<<
Position: 663, 337
Cursor ID: 0
Color: 0xD6D3CE
 
>>>> StatusBar <<<<
 
>>>> ToolsBar <<<<
 
>>>> Visible Text <<<<
Version 13.1.a.hf5.0003campusportal
Backup IIS Entries?
Backup Files?
...
C:CampusPortalBackup
Backup Path:
...
z:CampusPortal
Base Path:
E&xit
&Next >
Choose a base location and which applications will be installed.
Application Settings
 
 
>>>> Hidden Text <<<<
App Pool Credentials
Password:
Username:
Use Integrated Authentication?
Configure Portal Database?
Run Portal SQL Update Scripts?
Portal
Password:
Username:
Database Name:
Server Name:
Campus
Password:
Username:
Database Name:
Server Name:
Host Header:
Register ASP.Net with IIS?
IP Address:
global
DSBXDANSQL01
Description:
Branding Folder:
URL Name:
You are now ready to install/remove the selected applications.  Click the Begin button below to start the installation/removal/configuration process.
Clear All
Select All
Campus List:
Student:
Applicant:
Activate?
Employer:
Staff:
...
Portal:
Configuration Tool:
Admin Console:
127.0.0.1
SMTP Server:
seconds.
30
Query Interval:
50
Records Quantity:
Password:
NT DomainUser:
minute(s)
Staff Active Directory Settings:
dev
NT Domain:
dev.campusmgmt.com
Fully Qual.  Domain:
LDAP://OU=CampusUsers,DC=dev,DC=campusmgmt,DC=com
AD Path:
Student Active Directory Settings:
dev
NT Domain:
dev.campusmgmt.com
Fully Qual.  Domain:
LDAP://OU=CampusUsers,DC=dev,DC=campusmgmt,DC=com
AD Path:
1
Cache Refresh:
doc|rtf|pdf|xls|txt
0
Allowable File Types:
Cache Refresh Time:
Add
Allow IPs
...
Security Service:
Login Service:
...
Online Registration:
Payment Service:
Messaging Service:
Reporting Service:
Portal Data Service:
DSBXDANSQL01Reports
Default Report Path:
DSBXDANSQL01Reports
Custom Report Path:

Share this post


Link to post
Share on other sites



I'm not sure, but what If you send a SPACE button via ControlSend. It should inverse the selection (Checked -> Unchecked).

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