;~ Run("regsvr32 /s dm.dll")
RegDM();注册组件,发现个现象,组件放在桌面无法注册,因为桌面路劲含有空格 放到其他地方就可以
Global $DM = ObjCreate("dm.dmsoft")
If IsObj($DM) Then
$ver = $DM.Ver()
ConsoleWrite('当前大漠插件版本:' & $ver & @CRLF)
Else
MsgBox(64, '提示:', '注册大漠插件失败!!!')
Exit
EndIf
Func RegDM()
Local $dm_dll = '"'& @ScriptDir & '\dm.dll'&'"'
;以下的判断似乎对#RequireAdmin无效 ,都会执行
If @OSVersion = ('WIN_2008R2' Or 'WIN_7' Or 'WIN_2008' Or 'WIN_VISTA') Then
#RequireAdmin ;这个脚本需要完全控制权限
EndIf
Run("regsvr32 /s dm.dll")
;~ RunWait(@ComSpec & ' /c regsvr32 /s ' & $dm_dll, '', @SW_HIDE)
EndFunc
Dim $quhwnd =$dm.findwindow("","计算器") ;获取窗口句柄
$dm.bindwindow($quhwnd,"gdi","windows","windows",0) ;绑定窗口
Dim $is_bind=$dm.isbind($quhwnd) ;判读是否绑定成功
If $is_bind=1 Then
$temp=$dm.FindPicE(0,0,1024,768,"pic/11.bmp","000000",0.9,0) ;查找暂停。
If StringInStr($temp,"-1")=0 Then ;如果登录找到了
MsgBox(0,"",$temp)
$temp=StringSplit($temp,"|") ;则获取坐标
$dm.MoveTo($temp[2]+10,$temp[3]+4)
$dm.LeftClick()
EndIf
ElseIf $is_bind=0 Then
MsgBox(0,"","绑定失败"&$quhwnd)
EndIf
$dm.unbindwindow() ;解除绑定
|