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)
|