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. General Programming
  3. C / C++ / MFC
  4. Reload Icon when Explorer Crashes

Reload Icon when Explorer Crashes

Scheduled Pinned Locked Moved C / C++ / MFC
questioncom
10 Posts 6 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.
  • J Offline
    J Offline
    Jason Hooper
    wrote on last edited by
    #1

    Can someone point me in the right direction? The only way to access my app is via its tray icon. When Explorer does the nasty, it takes all the icons down with it. How can I detect that it has crashed and that my app needs to reinstall its icon? I'm using Chris' CSystemTray, and PJ's CInstanceChecker, and Windows 98 (if that helps). Thanks. :suss: -Jason nirgle.bitdevil.com

    N J J 3 Replies Last reply
    0
    • J Jason Hooper

      Can someone point me in the right direction? The only way to access my app is via its tray icon. When Explorer does the nasty, it takes all the icons down with it. How can I detect that it has crashed and that my app needs to reinstall its icon? I'm using Chris' CSystemTray, and PJ's CInstanceChecker, and Windows 98 (if that helps). Thanks. :suss: -Jason nirgle.bitdevil.com

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      In Win 2K when explorer crashes [that's rare, very rare] it has the decency to bring back all the icons on the task tray :-) I guess what the user could do is to run your program again and your program can check for an earlier version using a mutex and then re-add the icon to the tray. You can check for its existence by sending a NIM_MODIFY message and if it fails it means the icon is not there [I hope so] Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

      B 1 Reply Last reply
      0
      • J Jason Hooper

        Can someone point me in the right direction? The only way to access my app is via its tray icon. When Explorer does the nasty, it takes all the icons down with it. How can I detect that it has crashed and that my app needs to reinstall its icon? I'm using Chris' CSystemTray, and PJ's CInstanceChecker, and Windows 98 (if that helps). Thanks. :suss: -Jason nirgle.bitdevil.com

        J Offline
        J Offline
        Jon Hulatt
        wrote on last edited by
        #3

        personally, i'd install a timer, and in the timer proc (attempt to) remove the icon and reinstall it again. doing this every 5 seconds or so won't take much cpu time and should work ok. Sorry to dissapoint you all with my lack of a witty or poignant signature.

        1 Reply Last reply
        0
        • J Jason Hooper

          Can someone point me in the right direction? The only way to access my app is via its tray icon. When Explorer does the nasty, it takes all the icons down with it. How can I detect that it has crashed and that my app needs to reinstall its icon? I'm using Chris' CSystemTray, and PJ's CInstanceChecker, and Windows 98 (if that helps). Thanks. :suss: -Jason nirgle.bitdevil.com

          J Offline
          J Offline
          James R Twine
          wrote on last edited by
          #4

          How about doing it the way that Microsoft recommends...    Look up the "TaskbarCreated" registered message (requires that IE 4.0 or greater is installed).  It is sent by Explorer whenever the Taskbar is (re)created, so if Explorer crashes and restarts, your app will get sent the message, and can re-add its icon.    This is the way Services can install an Icon to the Taskbar's Status Area* when someone logs on.    * Calling it a "Tray Icon" is a common mistake.    Peace! -=- James.

          J M 2 Replies Last reply
          0
          • J James R Twine

            How about doing it the way that Microsoft recommends...    Look up the "TaskbarCreated" registered message (requires that IE 4.0 or greater is installed).  It is sent by Explorer whenever the Taskbar is (re)created, so if Explorer crashes and restarts, your app will get sent the message, and can re-add its icon.    This is the way Services can install an Icon to the Taskbar's Status Area* when someone logs on.    * Calling it a "Tray Icon" is a common mistake.    Peace! -=- James.

            J Offline
            J Offline
            Jason Hooper
            wrote on last edited by
            #5

            Thanks for the response; I'm looking into it now. And, what's the best way to crash Explorer (besides using it normally)? Gotta love testing :) -Jason nirgle.bitdevil.com

            J 1 Reply Last reply
            0
            • J James R Twine

              How about doing it the way that Microsoft recommends...    Look up the "TaskbarCreated" registered message (requires that IE 4.0 or greater is installed).  It is sent by Explorer whenever the Taskbar is (re)created, so if Explorer crashes and restarts, your app will get sent the message, and can re-add its icon.    This is the way Services can install an Icon to the Taskbar's Status Area* when someone logs on.    * Calling it a "Tray Icon" is a common mistake.    Peace! -=- James.

              M Offline
              M Offline
              Michael Dunn
              wrote on last edited by
              #6

              ****James R. Twine wrote: Calling it a "Tray Icon" is a common mistake. Err, why is that a mistake? --Mike-- My really out-of-date homepage He who laughs last, didn't get the punchline and is just laughing so he won't look silly. Sonork - 100.10414 AcidHelm Big fan of Alyson Hannigan.

              J 1 Reply Last reply
              0
              • N Nish Nishant

                In Win 2K when explorer crashes [that's rare, very rare] it has the decency to bring back all the icons on the task tray :-) I guess what the user could do is to run your program again and your program can check for an earlier version using a mutex and then re-add the icon to the tray. You can check for its existence by sending a NIM_MODIFY message and if it fails it means the icon is not there [I hope so] Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

                B Offline
                B Offline
                Bill Leibold
                wrote on last edited by
                #7

                Not true. I have never had an explorer crash in W2K where the task try icons were restored properly. Best Regards

                J 1 Reply Last reply
                0
                • J Jason Hooper

                  Thanks for the response; I'm looking into it now. And, what's the best way to crash Explorer (besides using it normally)? Gotta love testing :) -Jason nirgle.bitdevil.com

                  J Offline
                  J Offline
                  James R Twine
                  wrote on last edited by
                  #8

                  > And, what's the best way to crash Explorer (besides using it normally)?    On NT/Win@K, Task Manager, Processes tab, select Explorer, right-click and select End Process.    On Win9x, CTRL-ALT-DELETE, (while the task list dialog is up, click on the Explorer window (the desktop) a few times for about 5-10 seconds, and select Explorer int the dialog and try to end it. You should get the end task dialog for Explorer.    Peace! -=- James.

                  1 Reply Last reply
                  0
                  • M Michael Dunn

                    ****James R. Twine wrote: Calling it a "Tray Icon" is a common mistake. Err, why is that a mistake? --Mike-- My really out-of-date homepage He who laughs last, didn't get the punchline and is just laughing so he won't look silly. Sonork - 100.10414 AcidHelm Big fan of Alyson Hannigan.

                    J Offline
                    J Offline
                    James R Twine
                    wrote on last edited by
                    #9

                    Michael Dunn wrote: Err, why is that a mistake?    Because calling the Taskbar Notification Area the/a "Tray" is actually a mistake.  Hence, calling a Taskbar Noticification Area Icon a "Tray Icon" is also a mistake.    Sorta like the widely experienced mixup with "COM" being called both "Component Object Model" and "Common Object Model".    Peace! -=- James.

                    1 Reply Last reply
                    0
                    • B Bill Leibold

                      Not true. I have never had an explorer crash in W2K where the task try icons were restored properly. Best Regards

                      J Offline
                      J Offline
                      James R Twine
                      wrote on last edited by
                      #10

                      Bill Leibold wrote: Not true. I have never had an explorer crash in W2K where the task try icons were restored properly.    I think that Nish is just lucky enough to have apps on his system that correctly handle that situation (i.e. the "TaskbarCreated" message :))!    Peace! -=- James.

                      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