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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. System tray refresh?

System tray refresh?

Scheduled Pinned Locked Moved C#
csharpjsonhelptutorialquestion
16 Posts 5 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.
  • M mark_me

    Hi, I have created a windows application in C# that kills a process on a specified time and starts the same process at another time. The process kill is successful but icon in system tray still remains. Each time a new process is created, icons are added ..so one application has 3-4 icons with only one icon thats the real application and the rest disappear only whn u hover mouse over them. I believe that the system tray needs to be refreshed somehow. Can anyone provide help on how to get rid of the icons. Thanks

    B Offline
    B Offline
    Baeltazor
    wrote on last edited by
    #3

    When your application exits, inside the Form_Closing event handler you should use this code: notifyIcon1.Dispose(); That will ensure your 'system tray' icon gets removed when your application exits.

    Regards, Jason Pezzimenti.


    If you liked the answer that I have provided, then please click the 'Good Answer' link on the bottom-right of this post. Thank you.

    X M L 3 Replies Last reply
    0
    • B Baeltazor

      When your application exits, inside the Form_Closing event handler you should use this code: notifyIcon1.Dispose(); That will ensure your 'system tray' icon gets removed when your application exits.

      Regards, Jason Pezzimenti.


      If you liked the answer that I have provided, then please click the 'Good Answer' link on the bottom-right of this post. Thank you.

      X Offline
      X Offline
      Xmen Real
      wrote on last edited by
      #4

      he is killing other applications... :)

      TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia>

      ----------------------------------------------- 128 bit encrypted signature, crack if you can

      B 1 Reply Last reply
      0
      • X Xmen Real

        he is killing other applications... :)

        TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia>

        ----------------------------------------------- 128 bit encrypted signature, crack if you can

        B Offline
        B Offline
        Baeltazor
        wrote on last edited by
        #5

        Thanks for that. I only just realized, my brain no work properly this morning lol :)

        Regards, Jason Pezzimenti.


        If you liked the answer that I have provided, then please click the 'Good Answer' link on the bottom-right of this post. Thank you.

        1 Reply Last reply
        0
        • B Baeltazor

          When your application exits, inside the Form_Closing event handler you should use this code: notifyIcon1.Dispose(); That will ensure your 'system tray' icon gets removed when your application exits.

          Regards, Jason Pezzimenti.


          If you liked the answer that I have provided, then please click the 'Good Answer' link on the bottom-right of this post. Thank you.

          M Offline
          M Offline
          mark_me
          wrote on last edited by
          #6

          My application is a windows service. it doesn't have any icon. I am closing another application which has an icon. This application doesn't provide any interface to restart it so i find its processes in task manager, save it exe path from there and then kill the processes. The path is used to start the service again if needed. When i kill the process, its icon remains and disappears only when i move mouse over it.

          B M 2 Replies Last reply
          0
          • M mark_me

            My application is a windows service. it doesn't have any icon. I am closing another application which has an icon. This application doesn't provide any interface to restart it so i find its processes in task manager, save it exe path from there and then kill the processes. The path is used to start the service again if needed. When i kill the process, its icon remains and disappears only when i move mouse over it.

            B Offline
            B Offline
            Baeltazor
            wrote on last edited by
            #7

            Sorry for my misunderstanding in my previous post. It sounds like that article Xmen gave you would be the way to go. I hope it works out well. :)

            Regards, Jason Pezzimenti.


            If you liked the answer that I have provided, then please click the 'Good Answer' link on the bottom-right of this post. Thank you.

            M L 2 Replies Last reply
            0
            • X Xmen Real

              http://www.codeproject.com/KB/system/TrayIconBuster.aspx

              M Offline
              M Offline
              mark_me
              wrote on last edited by
              #8

              Thanx xmen.. Your reply is an answer but it seems that the application goes thru all processes... Is it possible to change ths code to "remove the icon for this process"... or do i have to read in all processes and then remove ones which have no filename... Actually, i realize that its a bit too early to reply coz i hvent looked into code that much... Thankyou for forwarding such a helpful application... Best regards

              1 Reply Last reply
              0
              • B Baeltazor

                Sorry for my misunderstanding in my previous post. It sounds like that article Xmen gave you would be the way to go. I hope it works out well. :)

                Regards, Jason Pezzimenti.


                If you liked the answer that I have provided, then please click the 'Good Answer' link on the bottom-right of this post. Thank you.

                M Offline
                M Offline
                mark_me
                wrote on last edited by
                #9

                Thankyou

                1 Reply Last reply
                0
                • B Baeltazor

                  When your application exits, inside the Form_Closing event handler you should use this code: notifyIcon1.Dispose(); That will ensure your 'system tray' icon gets removed when your application exits.

                  Regards, Jason Pezzimenti.


                  If you liked the answer that I have provided, then please click the 'Good Answer' link on the bottom-right of this post. Thank you.

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #10

                  Hi, Such exit code doesn't get executed when you kill a process. That is not the solution. Read the article that was mentioned, it works! :-D

                  Luc Pattyn [Forum Guidelines] [My Articles]


                  The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


                  M 1 Reply Last reply
                  0
                  • B Baeltazor

                    Sorry for my misunderstanding in my previous post. It sounds like that article Xmen gave you would be the way to go. I hope it works out well. :)

                    Regards, Jason Pezzimenti.


                    If you liked the answer that I have provided, then please click the 'Good Answer' link on the bottom-right of this post. Thank you.

                    L Offline
                    L Offline
                    Luc Pattyn
                    wrote on last edited by
                    #11

                    Of course it works, how dare you doubt that? :laugh: :laugh:

                    Luc Pattyn [Forum Guidelines] [My Articles]


                    The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


                    B 1 Reply Last reply
                    0
                    • L Luc Pattyn

                      Of course it works, how dare you doubt that? :laugh: :laugh:

                      Luc Pattyn [Forum Guidelines] [My Articles]


                      The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


                      B Offline
                      B Offline
                      Baeltazor
                      wrote on last edited by
                      #12

                      :laugh: That's a great article by the way :-D

                      Regards, Jason Pezzimenti.


                      L 1 Reply Last reply
                      0
                      • B Baeltazor

                        :laugh: That's a great article by the way :-D

                        Regards, Jason Pezzimenti.


                        L Offline
                        L Offline
                        Luc Pattyn
                        wrote on last edited by
                        #13

                        Thanks. I wanted the problem solved at that time, and no solution seemed to be available, so... :)

                        Luc Pattyn [Forum Guidelines] [My Articles]


                        The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


                        1 Reply Last reply
                        0
                        • L Luc Pattyn

                          Hi, Such exit code doesn't get executed when you kill a process. That is not the solution. Read the article that was mentioned, it works! :-D

                          Luc Pattyn [Forum Guidelines] [My Articles]


                          The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


                          M Offline
                          M Offline
                          mark_me
                          wrote on last edited by
                          #14

                          thanks and great article !!! Thanx alot

                          L 1 Reply Last reply
                          0
                          • M mark_me

                            thanks and great article !!! Thanx alot

                            L Offline
                            L Offline
                            Luc Pattyn
                            wrote on last edited by
                            #15

                            You're welcome. :)

                            Luc Pattyn [Forum Guidelines] [My Articles]


                            The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


                            1 Reply Last reply
                            0
                            • M mark_me

                              My application is a windows service. it doesn't have any icon. I am closing another application which has an icon. This application doesn't provide any interface to restart it so i find its processes in task manager, save it exe path from there and then kill the processes. The path is used to start the service again if needed. When i kill the process, its icon remains and disappears only when i move mouse over it.

                              M Offline
                              M Offline
                              Mycroft Holmes
                              wrote on last edited by
                              #16

                              mark_me wrote:

                              its icon remains and disappears only when i move mouse over it.

                              I wonder if it is an XP thing, I have something at work (put in place by those IT Gods who maintain our infrastructure) that creates the task manager icon at start up, it disappears if I do this.

                              Never underestimate the power of human stupidity RAH

                              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