Цитата kuzyaka:
как выбрать пункт меню "Обновить ..." »
|
Код:
#include <GuiToolBar.au3>
#include <GuiMenu.au3>
#include <WindowsConstants.au3>
$sToolTipTitle = "Отложено документов:"
$hSysTray_Handle = ControlGetHandle("[Class:Shell_TrayWnd]", "", "[Class:ToolbarWindow32;Instance:1]")
If @error Then Exit MsgBox(16, "Error", "System tray not found")
$iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle)
If $iSystray_ButCount = 0 Then Exit MsgBox(16, "Error", "No items found in system tray")
For $iSystray_ButtonNumber = 1 To $iSystray_ButCount
If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) Then ExitLoop
Next
If $iSystray_ButtonNumber = $iSystray_ButCount+1 Then Exit MsgBox(16, "Error", "Item Not Found")
_GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right", True, 1, 0)
WinWait("[CLASS:#32768]")
$hWndTray = WinGetHandle("[CLASS:#32768]")
$hMenu = _SendMessage($hWndTray, $MN_GETHMENU, 0, 0)
$aRect = _GUICtrlMenu_GetItemRect($hWndTray, $hMenu, 2)
MouseClick("left", $aRect[0]+5, $aRect[1]+5, 1, 1)