本帖最后由 小A 于 2011-4-10 17:53 编辑
以下代码经测试完全可行!DLL文件:
FileInstall("QMDispatch.dll", @SystemDir & "\QMDispatch.dll")
FileInstall("helper.dll", @SystemDir & "\helper.dll")
FileInstall("WinIo.dll", @SystemDir & "\WinIo.dll")
RunWait("Regsvr32 /s " & @SystemDir & "\QMDispatch.dll")
$obj = ObjCreate("QMDispatch.QMFunction")
;循环查找图片
While 1
$pos = _FindPic(1, 1, @DesktopWidth, @DesktopHeight, @ScriptDir & "\start.bmp", 1)
If $pos[0] > 0 Or $pos[1] > 0 Then ;如果$pos[0] > 0 与 $pos[1] > 0 说明找到图片.
MouseClick('left',$pos[0] + 40 ,$pos[1] + 10,1,0);发送鼠标点击
EndIf
Sleep(800)
WEnd
Func _FindPic($iLeft, $iTop, $iRight, $iBottom, $szFileName, $fSimilar)
Dim $pos[2]
$foundpixel = $obj.FindPic($iLeft, $iTop, $iRight, $iBottom, $szFileName, $fSimilar)
$pos[0] = Int($foundpixel / 8192)
$pos[1] = Mod($foundpixel, 8192)
Return $pos
EndFunc ;==>_FindPic
|