解决按钮开启CLASS 固定是WindowsForms10.BUTTON.app.0.378734a,
但是INSTANCE每次都可能变动
靠文字比对,取得当下的 CLASSNN
get ID or ClassNN for a control/button? - AutoIt General Help and Support -
AutoIt Forums
https://www.autoitscript.com/forum/topic/55372
-get-id-or-classnn-for-a-controlbutton/
$title = "Marshmallow Fluff Installer"
$text = ""
$checktext = "I understand by leaving this box checked I will be allowing the
Marshmallow Fluff Overlord to "
$i = 1
While Not @error = 1
If ControlCommand($title, $text, "Button" & $i, "IsVisible", "") Then
$text = ControlGetText($title, $text, "Button" & $i)
If StringInStr($text, $checktext) Then
If ControlCommand($title, $text, "Button" & $i, "IsChecked", "")
Then
ControlFocus($title, $text, "Button" & $i)
ControlClick($title, $text, "Button" & $i)
EndIf
MsgBox(64, "Unchecked", $text)
EndIf
EndIf
$i += 1