如何取消选中AutoIt中的复选框



如何取消选中复选框?

我真的希望这个复选框"取消选中"。我以前使用send_keys,我可以向它发送一个"已检查/未检查"的切换(空格),但当我发送切换时,它实际上可以被取消检查,然后它就会被检查,这是我不想要的。我希望它绝对是联合国检查。

我该怎么做?

到目前为止,这是我的AutoIt脚本:

#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
Local $Title = "Campus Portal Install"
Run("C:TempPortalInstall-13_1_A_HF5_0003cmcportalinstall.exe")
WinWaitActive($Title)
Send("z:CampusPortal")
ControlCommand($Title, "", "cbBackupIIS", "UnCheck")
ControlCommand($Title, "", "[NAME:cbBackupIIS]", "UnCheck")
ControlCommand($Title, "", 1049322, "UnCheck")
ControlCommand($Title, "", "[CLASS:#1049322]", "UnCheck")
ControlCommand($Title, "", "CLASS:Button]", "UnCheck")
ControlCommand($Title, "", "[WindowsForms10.BUTTON.app.0.2004eee]", "UnCheck")
ControlCommand("Campus Portal Install", "", "cbBackupIIS", "UnCheck")
ControlCommand("Campus Portal Install", "", "[NAME:cbBackupIIS]", "UnCheck")
ControlCommand("Campus Portal Install", "", 1049322, "UnCheck")
ControlCommand("Campus Portal Install", "", "[CLASS:#1049322]", "UnCheck")
ControlCommand("Campus Portal Install", "", "CLASS:Button]", "UnCheck")
ControlCommand("Campus Portal Install", "", "[WindowsForms10.BUTTON.app.0.2004eee]", "UnCheck")
MsgBox($MB_SYSTEMMODAL, "Title", "This message box will timeout after 10 seconds or select the OK button.", 10)

我尝试过的每一种变体都留下了;他们不会出错,所以把他们留在那里也无妨;另外,它显示了我所做的努力。

ControlSend工作正常。

以下是控制信息:

>>>> 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:
...
http://localhost:80/
Portal:
http://localhost:99/
Configuration Tool:
http://localhost:98/
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
...
http://localhost:91/
http://localhost:97/
Security Service:
Login Service:
...
http://localhost:95/
http://localhost:93/
http://localhost:92/
http://localhost:96/
Online Registration:
Payment Service:
Messaging Service:
http://localhost:94/
Reporting Service:
Portal Data Service:
\DSBXDANSQL01Reports
Default Report Path:
\DSBXDANSQL01Reports
Custom Report Path:

从这里的示例中,您应该能够使用_IsChecked($hWnd)来确定是否选中了复选框。按钮是复选框的正确类类型。

Mine也总是返回零。

我设法使用使其工作

   If ControlCommand("Login", "Login", $checkBox, "IsChecked") Then
       ControlCommand("Login", "Login", $checkBox, "Uncheck")
   EndIf

相关内容

  • 没有找到相关文章

最新更新