如何使用AutoIt单击Windows开始菜单中的项目?

时间:2013-09-21 09:14:32

标签: treeview autoit startmenu

我可以打开然后启动菜单,我可以在开始菜单中展开节点和子节点。现在,我该如何执行单击某个项目的操作,以便它启动相应的应用程序。

此致 纳齐尔

以下是我的代码的相关部分:

Send("^{ESC}")  ;[CTRL][ESC] to open the start menu
WinWaitActive("Start menu","")
ControlClick("Start menu","","[CLASS:Button; INSTANCE:1]") ;click on 'All Programs'
$hTree = ControlGetHandle("Start menu", "", "[CLASS:SysTreeView32; INSTANCE:1]") ; get handle to the treeview window
ControlTreeView("Start menu","",$hTree,"Expand", "#0|#13") ; expand a node
ControlTreeView("Start menu","",$hTree,"Expand", "#0|#13|#10") ; expand a child node of the above node

1 个答案:

答案 0 :(得分:0)

例如,如果您想选择第四项,请执行此操作。

Send("{DOWN 3}")
Send("{ENTER}")

如果你想确保你正在按下正确的窗口,你可以使用ControlSend()。