|
本帖最后由 kongzhuxin 于 2013-4-20 23:23 编辑
本想获取任务栏“开始”按钮的坐标位置,然后右键点击“开始”按钮,获得开始按钮属性,我写的代码始终不能得到“开始”按钮的坐标位置,我写的代码获得的坐标位置始终是桌面的左上角位置,我看不出代码有什么问题?麻烦好心人给与解答,谢谢了。
Opt("WinTitleMatchMode", 4)
;Opt("MouseCoordMode", 1)
WinActivate("[CLASS:Shell_TrayWnd]","开始")
Sleep(1000)
$sTrayWindow = WinGetHandle("[CLASS:Shell_TrayWnd]") ;窗口句柄
;Sleep(10000)
;$sStartButton = ControlGetHandle($sTrayWindow,"","Button1") ;开始按钮句柄
$pos = ControlGetPos("[CLASS:Shell_TrayWnd]","开始", "Button1")
Sleep(1000)
MouseMove($pos[0]+10,$pos[1]+10)
MouseClick("right", $pos[0]+10,$pos[1]+10, 1)
Send("{up}")
Sleep(1000)
Send("{up}")
Sleep(1000)
Send("{up}")
Sleep(1000)
Send("{Enter}")
Sleep(1000)
WinWaitActive("任务栏和「开始」菜单属性","经典「开始」菜单(&M)")
Sleep(1000)
ControlClick("任务栏和「开始」菜单属性","经典「开始」菜单(&M)","Button3",1)
Sleep(2000)
WinWaitActive("自定义「开始」菜单","常规")
Sleep(1000)
ControlClick("自定义「开始」菜单","常规","Button5",1)
Sleep(2000)
Send("^{tap}")
Sleep(1000)
ControlClick("自定义「开始」菜单","高级","Button6",1)
Sleep(6000)
ControlClick("自定义「开始」菜单","高级","Button7",1)
Sleep(5000)
WinWaitActive("任务栏和「开始」菜单属性","经典「开始」菜单(&M)")
Sleep(1000)
ControlClick("自定义「开始」菜单","常规","Button5",1)
Sleep(2000) |
|