Answers:
我通常使用ImageSearch来检查按钮的存在。
WinGetPos, , , Width, Height, A ;This gets the active window's size
Loop ;This loop searches for the button.
{
ImageSearch, FoundX, FoundY, 0, 0, Width, Height, %A_WorkingDir%\button.png
If ErrorLevel = 0
{
Msgbox, I found the button at %FoundX% %FoundY%.
break ;break the loop when the image is found
}
Sleep, 500
}