Is there any win32 functions that can get how many tray icons there are displayed and the text of them?
Is there any win32 functions that can get how many tray icons there are displayed and the text of them?
There must be some way to do it.
I was able to get the hwnd of the tray like this:
With that hwnd, I was able to kill the tray like so:Code:HWND hwndTaskBar = FindWindowEx(NULL, NULL, "Shell_TrayWnd", NULL); HWND hwndTray = FindWindowEx(hwndTaskBar, NULL, "TrayNotifyWnd", NULL);
Hopefully it'll come back when I reboot!Code:SendMessage(hwndTray, WM_DESTROY, 0, 0);
Anyway, there should be some way of asking the tray what it contains. I'm not sure what kind of control it is or if it's a standard control at all (a species of toolbar maybe?).
Tray icons are essentially programs that are running that have the window hidden. Note that you have to do more than hide or minimize your window to get your program into the tray but there really isn't anything special about the tray. I think that should give you a good start.
The code I posted actually just closes the tray itself, not the programs whose icons are displayed in it. I don't know how to get the actual info about the programs. I recall being able to get the number of icons currently in the tray but that's it.
The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss