Re: NotifyIcon Problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: james (nospam_at_hypercon.net)
Date: 01/17/05


Date: Mon, 17 Jan 2005 11:51:12 -0600

No, what I would prefer is that the Garbage Collector would recognize that
the app the created the Notify Icon is no longet running and clean up the
Icon. Or at least the Icon should be smart enough to know that its app is
gone and clean itself up. It would be the proper thing to do, but then...

JIM

"Mick Doherty"
<EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:eOcl9H$%23EHA.600@TK2MSFTNGP09.phx.gbl...
> When you hit the stop button, move your mouse over the icon in the System
> Tray and it will dissapear.
>
> The stop button kills your app and so does not clean up the NotifyIcons
> Icon as you told it to skip everything and just stop.
>
> Would you prefer that when you hit the stop button that it tried to clean
> up? In that case there would be no difference to terminating your app
> cleanly.
>
> --
> Mick Doherty
> http://dotnetrix.co.uk/nothing.html
>
>
> "james" <nospam@hypercon.net> wrote in message
> news:eOBivw%23%23EHA.1260@TK2MSFTNGP12.phx.gbl...
>> Sean,
>>
>> When developing a fairly large application it is just not always feasable
>> to Exit the application gracefully when debugging. For example, often
>> times I am stepping way down deep into code when I come accross an
>> obvious codeing error that I simply fix on the fly, kill the app and
>> re-start to check the fix. Now if I were to continue running the app
>> until I can get back to a main menu to exit gracefully, for the 300th
>> time in a day I would get very little done in a day. Also, in my app,
>> the Exit menu fires a bunch of code that saves state to the registry and
>> sometimes I want to avoid that - plus it is time consuming.
>>
>> thanks,
>>
>> JIM
>>
>>
>>
>> "Sean Hederman" <usemy@blogentry.com> wrote in message
>> news:csd3d6$nhp$1@ctb-nnrp2.saix.net...
>>> JIM,
>>>
>>> When you click the Stop icon in Visual Studio, it shuts down the entire
>>> application immediately without calling any closing or cleanup code.
>>> Rather try closing your application the way your users would, and then
>>> if your cleanup code makes the tray icon invisible, it should disappear.
>>>
>>> Regards
>>>
>>> --
>>> Sean Hederman
>>>
>>> http://codingsanity.blogspot.com
>>>
>>> "james" <nospam@hypercon.net> wrote in message
>>> news:OBaQ9nx%23EHA.1084@tk2msftngp13.phx.gbl...
>>>> Greg,
>>>>
>>>> What is the WS for? Anyway, which exit() routine are you referring to.
>>>> .Net Framework does not have exit() that I can find. Anyway, I should
>>>> point out that I already do have have NotifyIcon.Visible = false in
>>>> both my MainForm_Closing event and in my MainForm.Dispose() but when
>>>> developing inside VisualStudio, I do not think these get fired properly
>>>> when I kill the app by clicking the STOP button. Any other
>>>> suggestions?
>>>>
>>>> Thanks,
>>>>
>>>> JIM
>>>>
>>>>
>>>> "Greg Merideth" <beta-gm@forwardtechnology.net> wrote in message
>>>> news:quadnffempb7BXXcRVn-pQ@comcast.com...
>>>>> What you can do in your exit() routine is to do a:
>>>>>
>>>>> WSNotifyIcon.Visible=false;
>>>>>
>>>>> which will hide and remove the icon from the tray. Now when you run
>>>>> the app again there will not be several ghosted icons behind.
>>>>>
>>>>> james wrote:
>>>>>> My app has a notify Icon, but after the app exits, the Icon is still
>>>>>> visible, and then when I runthe app multiple times I get multiple
>>>>>> icons so that my status bas keeps accumulating them to the point it
>>>>>> becomes un-usable. The only fix I have found is to re-boot. Not a
>>>>>> godd solution. How do I get this to stop happening?
>>>>>>
>>>>>> Environment C#, VS.Net 2003, XP Pro
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> JIM
>>>>>>
>>>>
>>>
>>>
>>
>>
>
>


Quantcast