Jump to content

System Tray Items


Recommended Posts

Lets say I have msn messenger running on my system tray. I want to right click on it and select an option (say signout for example). Can I do this with autoit? If so, how?

Download PaulIA's AutoIt Library and install it. Then look at the Toolbar commands in his help file. This will give you a demo of some basic data from your SysTray (which is just a toolbar):

#include <A3LToolBar.au3>

Opt("WinTitleMatchMode", 4)
$hToolBar = WinGetHandle("[CLASS:Shell_TrayWnd]", "")
$hSysTray = ControlGetHandle($hToolBar, "", "ToolbarWindow321")
$BtnCnt = _Toolbar_ButtonCount($hSysTray)
$BtnData = ""
For $i = 0 To $BtnCnt - 1
    $BtnCmdID = _Toolbar_IndexToCommand($hSysTray, $i)
    $BtnTxt = _Toolbar_GetButtonText($hSysTray, $BtnCmdID)
    $BtnData &= "Index: " & $i & "   CommandID: " & $BtnCmdID & "   Text: " & $BtnTxt & @CRLF
Next
    
MsgBox(64, "Result", $BtnData)

:whistle:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Lets say I have msn messenger running on my system tray. I want to right click on it and select an option (say signout for example). Can I do this with autoit? If so, how?

PsaltyDS give the right pointer, but in practice, it's quite difficult to get working - given menu delay times, enabled/disables menu items (depending on whether MSN/Live messenger is signed in) etc.

For a working example, check out this link (also in my .sig)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...