本帖最后由 xiehuahere 于 2010-4-11 11:59 编辑
代码如下,还请帮忙找找原因:Opt("WinDetectHiddenText", 1)
Opt("WinTitleMatchMode", 4)
$windowFound = False
$controlID = "[CLASSNN:Static3]"
$matchText = "欢迎画面"
$WinArr = WinList("[CLASS:#32770]")
For $i = 1 To $WinArr[0][0]
$text = ControlGetText($WinArr[$i][1], "", $controlID)
ConsoleWrite($WinArr[$i][1] & ": " & $text & @LF) ;[b]不知为什么这里输出的$text都是空,难道中文不行吗?
If ControlGetText($WinArr[$i][1], "", $controlID) = $matchText Then
$windowFound = True
ExitLoop
EndIf
Next
If $windowFound Then
MsgBox(0, "WinExists", "The target window does indeed exist.")
Else
MsgBox(0, "Not Found", ";-(")
EndIf
多谢! |