Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - How to tell if a window is in system tray? | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 2052/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 11-14-04 11:53 PM Link | Quote
I've been working on a custom taskbar using EnumWindows, and it's working good, but I've hit a problem with emulating the system tray. I need to know how to tell what windows are in it, get their icons, and send mousemove/click/etc messages to them when moving/clicking the tray icons. Any ideas?
Dish

Spiny
Level: 38

Posts: 193/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 11-15-04 06:57 AM Link | Quote
Can't help you with this one... I haven't done any work involving the system tray ever. But I'm kind of interested... so if you find out elsewhere, could you post your findings (or a link to them) in here? ^^
dan

Snap Dragon
Level: 43

Posts: 239/782
EXP: 534516
For next: 30530

Since: 03-15-04

Since last post: 20 hours
Last activity: 14 hours
Posted on 11-15-04 01:28 PM Link | Quote
Presumably, the system tray just monitors for an application that is trying to put itself in there. There's probably no API functions or anything to enumerate through the applications that put themselves in there. (Well, of course this is only a guess, because when Windows Explorer crashes, the system tray gets emptied too)
Gavin

Fuzzy
Rhinoceruses don't play games. They fucking charge your ass.
Level: 43

Posts: 307/799
EXP: 551711
For next: 13335

Since: 03-15-04
From: IL, USA

Since last post: 13 hours
Last activity: 13 hours
Posted on 11-15-04 02:15 PM Link | Quote
Originally posted by dan
Presumably, the system tray just monitors for an application that is trying to put itself in there. There's probably no API functions or anything to enumerate through the applications that put themselves in there. (Well, of course this is only a guess, because when Windows Explorer crashes, the system tray gets emptied too)


that is my understanding of it as well. I was reading up on a document (rather dated, keep in mind) that suggested just that: there is no exact way to determine if a window/form is being kept in the system tray. I suppose if you're emulation of the system tray is targeted at a specific program, your idea could still work. Otherwise, if you are not targeting a specific process, i you might be out of luck.

if you're going to be messing with the taskbar though, look into SHAppBarMessage
dan

Snap Dragon
Level: 43

Posts: 240/782
EXP: 534516
For next: 30530

Since: 03-15-04

Since last post: 20 hours
Last activity: 14 hours
Posted on 11-15-04 05:11 PM Link | Quote
I believe this website should help you a bit: http://skyscraper.fortunecity.com/gigo/311/winprog.html

There's sample C++ code to enumerate the currently displayed tray icons. It seems to actually hook into the tray, which I presume is some kind of hacky way of doing it.
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 2061/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 11-16-04 01:32 AM Link | Quote
Hmm, so you have to use an image list for icons? Nuts, I was hoping to avoid that. Anyway, I figured there must be some window attribute that tells it? (Can't just be constantly monitoring for it, since if you close/restart it or it crashes, the icons are all still in it.)

Anyway, this code won't work... All it does is patch into the existing taskbar. Mine is a replacement taskbar/shell, so explorer.exe won't be running.
Jesper
Busy, busy, busy.
Level: 69

Posts: 1291/2390
EXP: 2856000
For next: 13743

Since: 03-15-04
From: Sweden.

Since last post: 176 days
Last activity: 79 days
Posted on 11-30-04 09:22 PM Link | Quote
The System Tray works like this: people call an API to register a tray icon (provide a tooltip, icon, window handle, process pointer), and later one to unregister them (that's why programs that crash still have their icon there but it disappears when you hover it - Windows sends a mouseover event to the program, notices that it has quit and removes the icon on its own). Explorer.exe receives those messages somehow - you'll have to hack a way to make your shell get those messages instead.
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 2202/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 11-30-04 11:07 PM Link | Quote
Thanks, that helps a lot. Now if you just so happened to know what message, and how they send it... (Do they look for a special window, send it to all the windows, etc?)
Jesper
Busy, busy, busy.
Level: 69

Posts: 1331/2390
EXP: 2856000
For next: 13743

Since: 03-15-04
From: Sweden.

Since last post: 176 days
Last activity: 79 days
Posted on 12-03-04 11:51 PM Link | Quote
Shell_NotifyIcon. Unfortunately it's sent directly to shell32.dll so you'll have to find out a way to "listen in".
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Programming - How to tell if a window is in system tray? | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.009 seconds.