I wonder... is there an option in Autoit to choose an option for a program running in the system tray?
For example: Right click on MSN Messenger and choose Log off (Afmelden in Dutch

Hope this can be done.
Posted 22 September 2011 - 11:58 AM

Posted 22 September 2011 - 12:07 PM
#Include <GuiToolBar.au3> Global $hSysTray_Handle, $iSystray_ButtonNumber Global $sToolTipTitle = "" ; <<<<<<<<<<<<<<<< Enter some tooltip text for the icon you want here $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle) If $iSystray_ButtonNumber = 0 Then MsgBox(16, "Error", "Icon not found in system tray") Exit Else Sleep(500) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right") EndIf Exit ;............ Func Get_Systray_Index($sToolTipTitle) ; Find systray handle $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Get systray item count Local $iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSystray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Look for wanted tooltip For $iSystray_ButtonNumber = 0 To $iSystray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) <> 0 Then ExitLoop Next If $iSystray_ButtonNumber = $iSystray_ButCount Then Return 0 ; Not found Else Return $iSystray_ButtonNumber ; Found EndIf EndFunc
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
Posted 22 September 2011 - 02:30 PM
Posted 23 September 2011 - 07:20 AM

Posted 23 September 2011 - 11:26 AM
#include <WindowsConstants.au3> #include <GUIToolbar.au3> #include <WinAPI.au3> #Include <GuiMenu.au3> Opt("WinTitleMatchMode", 2) Global $hSysTray_Handle, $iSystray_ButtonNumber Global $sToolTipTitle = "" ; Add the text of your tray icon here <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle) If $iSystray_ButtonNumber = 0 Then MsgBox(16, "Error", "Is the App running?") Exit Else Sleep(250) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right") Sleep(250) Send("{UP}") ; Move your cursor around on the menu here <<<<<<<<<<<<<<<<<<<<<<<<<<< ConsoleWrite(GetPopUpSelText() & @CRLF) ; This will read the currently selected item <<<<<<<<<<<<<<<<<<<<<<<<<<<< EndIf Func Get_Systray_Index($sToolTipTitle) ; Find systray handle $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Get systray item count Local $iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSystray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Look for wanted tooltip For $iSystray_ButtonNumber = 0 To $iSystray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) <> 0 Then ExitLoop Next If $iSystray_ButtonNumber = $iSystray_ButCount Then Return 0 ; Not found Else Return $iSystray_ButtonNumber ; Found EndIf EndFunc Func GetPopUpSelText() Local $aPopUp_List = _WinAPI_EnumWindowsPopup() Local $hWnd = $aPopUp_List[1][0] Local $sClass = $aPopUp_List[1][1] If $sClass = "#32768" Then ; This is a "standard" Windows API popup menu $hMenu = _SendMessage($hWnd, $MN_GETHMENU, 0, 0) If _GUICtrlMenu_IsMenu($hMenu) Then $iCount = _GUICtrlMenu_GetItemCount($hMenu) For $j = 0 To $iCount - 1 If _GUICtrlMenu_GetItemHighlighted($hMenu, $j) Then Return _GUICtrlMenu_GetItemText($hMenu, $j) EndIf Next EndIf EndIf Return "" EndFunc
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
Posted 22 November 2011 - 09:56 AM
But i still cant get it to work, any ideas?Juvigy, Since the instance # for the 'Notification Area' can vary between O/S's, you might want to alter the following line:
$hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]')
to search for '[CLASS:ToolbarWindow32;TEXT:Notification Area]' on anything pre-Windows 7, and for Windows 7:
"[CLASS:ToolbarWindow32;TEXT:User Promoted Notification Area]".
Posted 22 November 2011 - 10:26 AM
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
Posted 22 November 2011 - 11:57 AM
Edited by bmw540, 23 November 2011 - 12:51 PM.
Posted 22 November 2011 - 12:08 PM
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
Posted 22 November 2011 - 12:37 PM
I don't know where I'm going, but I'm on my way.
Posted 22 November 2011 - 02:01 PM
Posted 22 November 2011 - 03:10 PM
#include <WindowsConstants.au3> #include <GUIToolbar.au3> #include <WinAPI.au3> #Include <GuiMenu.au3> ; PNA uninstalled and Receiver installed ; Start showing Notification Area Icons Send( '^{ESC}' ) ; Presses the StartMenu button Sleep(250) Send( '^{ESC}' ) ; Presses the StartMenu button Sleep(250) Send("{APPSKEY}") ; RightClicks the StartMenu button Sleep(250) Send("{UP}") ; Moves to Properties of the StartMenu button Sleep(250) Send("{ENTER}") ; Presses Enter on the Properties of the StartMenu button Sleep(250) Send("{TAB}{TAB}{TAB}{TAB}{TAB}{ENTER}") ; Tabs down to "Anpassa" and presses Enter Sleep(10000) ; Wait for the properties window to appear Send("+{TAB}") ; Sends Shift-TAB to highlight "Visa alltid alla ikoner och meddelanden i Aktivitetsfältet" Sleep(250) Send("{SPACE}") ; Sends space to select the above Sleep(250) Send("{TAB}") ; Sends TAB to higlight "OK" Sleep(250) Send("{ENTER}") ; Sends ENTER to save settings Sleep(250) Send("{TAB}{TAB}{TAB}{ENTER}") ; Tabs down to "OK or Avbryt" to exit ; Now all Notification Area icons shall be visible Sleep(500) ; Now the customize Citrix receiver part starts Opt("WinTitleMatchMode", 2) Global $hSysTray_Handle, $iSystray_ButtonNumber Global $sToolTipTitle = "Citrix Receiver" ; Add the text of your tray icon here <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle) If $iSystray_ButtonNumber = 0 Then MsgBox(16, "Error", "Is the App running?") Exit Else Sleep(500) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right") ; Rightclicks Citrix Receiver Sleep(500) Send("{DOWN}{ENTER}") ; Walk down to "Preferences" and press enter Sleep(2000) ; Wait 1 sec to let it load Preferences Send("{UP}") ; Jump up to "User Settings" Sleep(250) Send("{TAB}") ; Jump to "Show advanced Receiver menu items" Sleep(250) Send("{SPACE}") ; Sends SPACE to select the above Sleep(250) Send("+{TAB}"); Sends Shift-TAB to jump back to "User Settings" Sleep(250) Send("{DOWN}"); Sends DOWN to move to "Plug-in status" Sleep(250) Send("{TAB}") ; Sends TAB to move to "Online Plug-in......." Sleep(250) Send("{APPSKEY}"); RightClicks the above Sleep(250) Send("{UP}"); Sends UP to jump to "Options" Sleep(250) Send("{ENTER}"); Sends ENTER on the above Sleep(250) Send("+{TAB}"); Sends Shift-TAB to jump back to "Server Options" Sleep(250) Send("{DOWN}"); Sends DOWN to jump to "Application Display" Sleep(250) Send("{TAB}") ; Sends TAB to move to "Show applications in Start Menu" Sleep(250) Send("{TAB}"); Sends TAB to move to field "Additional submenu" Sleep(250) Send("Citrix Program"); Enters the desired text in the field above Sleep(1500) Send("{ENTER}"); Closes the window Sleep(250) Send("{TAB}"); Jumps to "OK" Sleep(250) Send("{ENTER}"); Sends ENTER to exit above ; Reciever part is finished ; Now hiding all Notification Area icons starts Send( '^{ESC}' ) ; Presses the StartMenu button Sleep(250) Send( '^{ESC}' ) ; Presses the StartMenu button Sleep(250) Send("{APPSKEY}") ; RightClicks the StartMenu button Sleep(250) Send("{UP}") ; Moves to Properties of the StartMenu button Sleep(250) Send("{ENTER}") ; Presses Enter on the Properties of the StartMenu button Sleep(250) Send("{TAB}{TAB}{TAB}{TAB}{TAB}{ENTER}") ; Tabs down to "Anpassa" and presses Enter Sleep(10000) ; Wait for the properties window to appear Send("+{TAB}"); Sends Shift-TAB to highlight "Visa alltid alla ikoner och meddelanden i Aktivitetsfältet" Sleep(250) Send("{SPACE}") ; Sends space to select the above Sleep(250) Send("{TAB}") ; Sends TAB to higlight "OK" Sleep(250) Send("{ENTER}") ; Sends ENTER to save settings Sleep(250) Send("{TAB}{TAB}{TAB}{ENTER}") ; Tabs down to "OK or Avbryt" to exit Sleep(250) ; Now the Notification Area icons shall be as before the script run ConsoleWrite(GetPopUpSelText() & @CRLF) ; This will read the currently selected item <<<<<<<<<<<<<<<<<<<<<<<<<<<< EndIf Func Get_Systray_Index($sToolTipTitle) ; Find systray handle $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Get systray item count Local $iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSystray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Look for wanted tooltip For $iSystray_ButtonNumber = 0 To $iSystray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) <> 0 Then ExitLoop Next If $iSystray_ButtonNumber = $iSystray_ButCount Then Return 0 ; Not found Else Return $iSystray_ButtonNumber ; Found EndIf EndFunc Func GetPopUpSelText() Local $aPopUp_List = _WinAPI_EnumWindowsPopup() Local $hWnd = $aPopUp_List[1][0] Local $sClass = $aPopUp_List[1][1] If $sClass = "#32768" Then ; This is a "standard" Windows API popup menu $hMenu = _SendMessage($hWnd, $MN_GETHMENU, 0, 0) If _GUICtrlMenu_IsMenu($hMenu) Then $iCount = _GUICtrlMenu_GetItemCount($hMenu) For $j = 0 To $iCount - 1 If _GUICtrlMenu_GetItemHighlighted($hMenu, $j) Then Return _GUICtrlMenu_GetItemText($hMenu, $j) EndIf Next EndIf EndIf Return "" EndFunc func rightclick() MouseClick("right") endfunc
Posted 22 November 2011 - 03:16 PM
If by that you mean hiding the mouse cursor while it does its thing, I am afraid not.Is there any way to hide whats happening
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
Posted 23 November 2011 - 08:27 AM
Posted 23 November 2011 - 08:42 AM
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
0 members, 1 guests, 0 anonymous users