$dll_path=@ScriptDir & '\dm.dll'
Global $DM = _RegDM($dll_path)
If IsObj($DM) Then
$ver = $DM.Ver()
;~ MsgBox(0,0,'> 插件版本:' & $ver & @CRLF)
Else
MsgBox(64, '提示:', '注册大漠插件失败!!!')
Exit
EndIf
Func _RegDM($dll_path)
Local $obj = ObjCreate("dm.dmsoft")
If Not IsObj($obj) Then
RunWait(@ComSpec & ' /c regsvr32 /s ' & FileGetShortName($dll_path), '', @SW_HIDE)
$obj = ObjCreate("dm.dmsoft")
EndIf
Return $obj
EndFunc
;********************************以上是注册插件命令,需要使用时,直接复制上面的代码即可**********
;~ ;屏幕识别
Local $intx,$inty ;特别注意:此处只能定义,或者赋值为空,否则出错!!
$a=TimerInit()
$dm.findpic(0,0,@DesktopWidth,@DesktopHeight,"E:\桌面\test.bmp",000000,1,0,$intx,$inty)
If $intx>0 And $inty>0 Then
$b=TimerDiff($a)
MsgBox(0,0,'找到啦'&@CRLF&"找图总用时:"&$b,2)
MouseMove($intx,$inty)
Else
MsgBox(16,'错误','我擦!!没有找到匹配图像!!!',3)
EndIf
|