找回密码
 加入
搜索
查看: 1715|回复: 2

AutoIT能操作托盘任务里的图标吗?

[复制链接]
发表于 2009-7-30 02:51:26 | 显示全部楼层 |阅读模式
AutoIT能操作托盘任务里的图标吗?
例如对托盘里的QQ企鹅图标发送鼠标右键,并选择点击退出。
发表于 2009-7-30 03:48:46 | 显示全部楼层
发表于 2009-7-30 04:59:38 | 显示全部楼层
Dim $hPopupMenu, $hToolbar, $iButCount, $hButton, $cID

$hToolbar = ControlGetHandle("[Class:Shell_TrayWnd]", "", "[Class:ToolbarWindow32;Instance:1]")
If @error Then Exit

$iButCount = _GUICtrlToolbar_ButtonCount($hToolbar)

If $iButCount = 0 Then 
        MsgBox(0, "错误", "没有找到托盘程序!")
        Exit
EndIf

$hButton = ControlGetHandle("[Class:Shell_TrayWnd]", "", "Button2")
If $hButton <> "" Then ControlClick("[Class:Shell_TrayWnd]", "", "Button2")
For $i = 0 to $iButCount - 1
        $cID = _GUICtrlToolbar_IndexToCommand($hToolBar, $i)
        if StringInStr(_GUICtrlToolbar_GetButtonText($hToolBar,$cID),"QQ") Then
       ExitLoop
        EndIf
Next

_GUICtrlToolbar_ClickButton($hToolBar, $cID, "right", True)
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-22 23:27 , Processed in 0.078922 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表