tags:

views:

163

answers:

1

I want to monitor the windows system tray for icon text changes.

How can I do this in .Net preferably in C#?

+1  A: 

This is possible using FindWindow with "Shell_TrayWnd" and SendData in the Windows API.

To do this in C#, you'll need to P/Invoke into the Windows API. Here is set of a C++ sample code you can use to port.

Reed Copsey
Note that this is completely undocumented and will probably break between OS releases.
Michael
@Michael: Yes, of course. To my knowledge, though, this works on XP, 2003, and Vista - haven't tried it on 2008 or Win7, though. Spy++ works well for figuring out the names of the windows to use with FindWindow. I don't believe there is a Windows API for this directly, though.
Reed Copsey