需使用新版本
;========================================
SysGet, VirtualHeight, 79
SysGet, VirtualWidth, 78
SysGet, VirtualX, 76
SysGet, VirtualY, 77
;========================================
^F5::Reload
;========================================
^+j::
ImageFolderPath := "C:\Users\jason\Desktop\U2\"
ImagesExist := ImageFolderSearch(ImageFolderPath)
if (ImagesExist) {
MsgBox, OK
} else {
MsgBox, 找不到圖片
}
return
ImageFolderSearch(folderPath) {
FileList := ""
Loop, Files, %folderPath%*.png
{
FileList .= A_LoopFileFullPath "`n"
}
Loop, Parse, FileList, `n
{
ImagePath := A_LoopField
if (FileExist(ImagePath)) {
if (ImageSearchDLL(ImagePath)) {
return true
}
}
}
return false
}
ImageSearchDLL(imagePath) {
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, %imagePath%
return (ErrorLevel == "0")
}