Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. Restoring System Tray Icons

Restoring System Tray Icons

Scheduled Pinned Locked Moved System Admin
sysadminhelptutorialquestion
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Roger Wright
    wrote on last edited by
    #1

    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

    S R 2 Replies Last reply
    0
    • R Roger Wright

      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

      S Offline
      S Offline
      Sarvesvara BVKS Dasa
      wrote on last edited by
      #2

      Roger Wright wrote: to restart the PC logoff too helps I guess :confused::confused: I was born intelligent
      Education ruined me!.

      R 1 Reply Last reply
      0
      • S Sarvesvara BVKS Dasa

        Roger Wright wrote: to restart the PC logoff too helps I guess :confused::confused: I was born intelligent
        Education ruined me!.

        R Offline
        R Offline
        Roger Wright
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • R Roger Wright

          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

          R Offline
          R Offline
          Robert Little
          wrote on last edited by
          #4

          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?

          R 1 Reply Last reply
          0
          • R Robert Little

            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?

            R Offline
            R Offline
            Roger Wright
            wrote on last edited by
            #5

            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

            J R 2 Replies Last reply
            0
            • R Roger Wright

              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

              J Offline
              J Offline
              J Dunlap
              wrote on last edited by
              #6

              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 Gandhi

              R 1 Reply Last reply
              0
              • J J Dunlap

                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 Gandhi

                R Offline
                R Offline
                Roger Wright
                wrote on last edited by
                #7

                Sure! 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

                1 Reply Last reply
                0
                • R Roger Wright

                  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

                  R Offline
                  R Offline
                  Robert Little
                  wrote on last edited by
                  #8

                  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.

                  R 1 Reply Last reply
                  0
                  • R Robert Little

                    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.

                    R Offline
                    R Offline
                    Roger Wright
                    wrote on last edited by
                    #9

                    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

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups