本帖最后由 121044246 于 2014-4-16 16:21 编辑
回复 5# yuan278501381
http://autoitx.com/thread-18391-1-1.html
查找图片点击ShellExecuteWait("QMDispatch.exe");将QMDispatch.exe与脚本放在同一个目录
ShellExecute("regsvr32.exe",@SystemDir&"\QMDispatch.dll /s")
findImage()
FileDelete(@SystemDir&"\360.bmp")
FileDelete(@SystemDir&"\close.bmp")
Func findImage()
$pos = _FindPic(0, 0, @DesktopWidth, @DesktopHeight, @SystemDir&"\360.bmp",1)
MouseClick("left",$pos[0], $pos[1],1,0)
Sleep(1000)
$pos1 = _FindPic(0, 0, @DesktopWidth, @DesktopHeight, @SystemDir&"\close.bmp",1)
MouseClick("left",$pos1[0], $pos1[1],1,0)
EndFunc ;==>findImage
Func _FindPic($iLeft, $iTop, $iRight, $iBottom, $szFileName, $fSimilar)
Dim $pos[2]
$obj = ObjCreate("QMDispatch.QMFunction")
$foundpixel = $obj.FindPic($iLeft, $iTop, $iRight, $iBottom, $szFileName, $fSimilar)
$pos[0] = Int($foundpixel / 8192)
$pos[1] = Mod($foundpixel, 8192)
Return $pos
EndFunc ;==>FindPic
|