Restoring System Tray Icons
-
I usually have 8 - 10 programs running and displayed in the System Tray. Explorer.exe tends to crash and restart regularly - notably every time I try to explore a computer in My Network Places that isn't currently available - and it doesn't restore all of the icons to the Tray when it restarts. My only options are to restart the PC, or to open a second instance of a program that is already running to get the icons and their associated functions back. How would I go about writing a function for a program to capture an already running instance and restore the icon associated with it to the Tray without having to restart the computer? I'm sure that it can be done, as my AV program always restores itself after a restart of explorer.exe. But Trillian, Sonork, and the Client Manager for my wireless Internet link do not. I'd like to add that option to any programs I write but I havn't a clue how to approach the problem. How would you do it? "Please don't put cigarette butts in the urinal. It makes them soggy and hard to light" - Sign in a Bullhead City, AZ Restroom
-
I usually have 8 - 10 programs running and displayed in the System Tray. Explorer.exe tends to crash and restart regularly - notably every time I try to explore a computer in My Network Places that isn't currently available - and it doesn't restore all of the icons to the Tray when it restarts. My only options are to restart the PC, or to open a second instance of a program that is already running to get the icons and their associated functions back. How would I go about writing a function for a program to capture an already running instance and restore the icon associated with it to the Tray without having to restart the computer? I'm sure that it can be done, as my AV program always restores itself after a restart of explorer.exe. But Trillian, Sonork, and the Client Manager for my wireless Internet link do not. I'd like to add that option to any programs I write but I havn't a clue how to approach the problem. How would you do it? "Please don't put cigarette butts in the urinal. It makes them soggy and hard to light" - Sign in a Bullhead City, AZ Restroom
Roger Wright wrote: to restart the PC logoff too helps I guess :confused::confused: I was born intelligent
Education ruined me!. -
Roger Wright wrote: to restart the PC logoff too helps I guess :confused::confused: I was born intelligent
Education ruined me!.I had to check just now to see if that option exists in Win2K Server - I've never used it.:-O I'll give it a try next time I lose explorer.exe. Thanks for the suggestion! "Please don't put cigarette butts in the urinal. It makes them soggy and hard to light" - Sign in a Bullhead City, AZ Restroom
-
I usually have 8 - 10 programs running and displayed in the System Tray. Explorer.exe tends to crash and restart regularly - notably every time I try to explore a computer in My Network Places that isn't currently available - and it doesn't restore all of the icons to the Tray when it restarts. My only options are to restart the PC, or to open a second instance of a program that is already running to get the icons and their associated functions back. How would I go about writing a function for a program to capture an already running instance and restore the icon associated with it to the Tray without having to restart the computer? I'm sure that it can be done, as my AV program always restores itself after a restart of explorer.exe. But Trillian, Sonork, and the Client Manager for my wireless Internet link do not. I'd like to add that option to any programs I write but I havn't a clue how to approach the problem. How would you do it? "Please don't put cigarette butts in the urinal. It makes them soggy and hard to light" - Sign in a Bullhead City, AZ Restroom
If it is not a program that you have access to then your only option is to either restart the system or log off and back on. In W2k I can log off and back on and that works. Generally when you log off W2k will shut down any processes that you are running and then they will restart when you log back in. If you write the program then there is a possible option. To add an icon to the system tray you use the Shell_NotifyIcon with the NIM_ADD parameter. I recall reading somewhere that you could register with the windows system to notify you when the shell was started. This is how programs that run before you log on are able to put an icon into the tray once you do log in. I can't seem to find the reference to it now. I think this is only available with the 5.x or higher version of the shell though. I'll do some searching on MSDN for it. Maybe this message will ring a bell for someone else that has used it and they can pull it out of their hat quicker. I can't remember where I say it. My quick check of the shell functions didn't find anything. It may be a windows subsystem hook? Anyone?
-
If it is not a program that you have access to then your only option is to either restart the system or log off and back on. In W2k I can log off and back on and that works. Generally when you log off W2k will shut down any processes that you are running and then they will restart when you log back in. If you write the program then there is a possible option. To add an icon to the system tray you use the Shell_NotifyIcon with the NIM_ADD parameter. I recall reading somewhere that you could register with the windows system to notify you when the shell was started. This is how programs that run before you log on are able to put an icon into the tray once you do log in. I can't seem to find the reference to it now. I think this is only available with the 5.x or higher version of the shell though. I'll do some searching on MSDN for it. Maybe this message will ring a bell for someone else that has used it and they can pull it out of their hat quicker. I can't remember where I say it. My quick check of the shell functions didn't find anything. It may be a windows subsystem hook? Anyone?
Good info - Thanks! I'll do a hunt for the shell functions that relate to this. It would be nice to have anything I write that lives in the tray be self-healing when Windows breaks. "Please don't put cigarette butts in the urinal. It makes them soggy and hard to light" - Sign in a Bullhead City, AZ Restroom
-
Good info - Thanks! I'll do a hunt for the shell functions that relate to this. It would be nice to have anything I write that lives in the tray be self-healing when Windows breaks. "Please don't put cigarette butts in the urinal. It makes them soggy and hard to light" - Sign in a Bullhead City, AZ Restroom
-
If you find something on this, will you be so kind as to write an article on it? ;)
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma GandhiSure! Testing will be easy - all I have to do is try to open a computer in Network Neighborhood that I'm not allowed to access to crash Windows Explorer! X| "Please don't put cigarette butts in the urinal. It makes them soggy and hard to light" - Sign in a Bullhead City, AZ Restroom
-
Good info - Thanks! I'll do a hunt for the shell functions that relate to this. It would be nice to have anything I write that lives in the tray be self-healing when Windows breaks. "Please don't put cigarette butts in the urinal. It makes them soggy and hard to light" - Sign in a Bullhead City, AZ Restroom
Try this URL. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp Scroll down to the section that describes "Taskbar Creation Notification." It provides some source code that I think might give you what you need. It states that it requires IE 4.0 and later to work though.
-
Try this URL. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp Scroll down to the section that describes "Taskbar Creation Notification." It provides some source code that I think might give you what you need. It states that it requires IE 4.0 and later to work though.
Great link - Thanks! I don't think a requirement for IE4 is much of a problem anymore, though I do have huge problems with MS no longer offerring the full IE as a download. I'm seeing very few versions lower than 5.0 installed on users' PCs these days. "Please don't put cigarette butts in the urinal. It makes them soggy and hard to light" - Sign in a Bullhead City, AZ Restroom