本帖最后由 半芯竹 于 2012-1-11 16:23 编辑
回复 3# mid_w #include 'ServiceControl.au3'
#RequireAdmin
Dim $1="[CLASS:MMCMainFrame]";=====定义服务窗口
If WinExists($1,'')=False Then
ShellExecute("Services.msc")
WinWait($1,'',10)
Sleep(1000)
Else
WinActivate($1,"")
Sleep(1000)
EndIf
$a = _ServGetDetails('W32Time')
If @error <> -1 Then
Local $ix = ControlListView($1, '', 'SysListView321', 'FindItem', "Windows Time", 0)
Local $ix1 = ControlListView($1, '', 'SysListView321', 'select', $ix)
ControlFocus($1, '', 'SysListView321')
If $a[4]<>"stopped" Then
Sleep(1000)
ControlClick ($1, '', 'ToolbarWindow321', 'left', 1, 249, 11);点击相对控件停止服务
Else
ControlClick ($1, '', 'ToolbarWindow321', 'left', 1, 227, 11);点击相对控件,开启服务
EndIf
EndIf
以下为图解。相对于控件ToolbarWindow321坐标图示:
|