PC Review


Reply
Thread Tools Rate Thread

How to avoid application killing while have NotifyIcon active?

 
 
Andrew Nugged
Guest
Posts: n/a
 
      8th May 2005
When I am teach my small tool to sit as NotifyIcon and make my main
window this.Hide() it's all okay - but when I popped up again, and
window is active and I ask some other programs to close all programs
(and also Settings->Memory->Running programs->Stop All->EndTask) my
program is killed... But I don't want to - I want it to hide window on
this and still be in tray...

and, by the way - after killing program there's empty icon place in
tray are still busy and when I am running my program again - icon
appears next to this empty but busy place... and those places are
cleared only, of course, after reset...

Please advice me...

 
Reply With Quote
 
 
 
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      9th May 2005
Well, if the other application is using TerminateProcess, there's *nothing*
you can do; your application is dead and that's all there is to it. If
you're getting a CLOSE message from that other program that's trying to
close everything, you could, instead of closing, hide your form again. We
can't remotely diagnose what's going on unless you know more about this
second program that's closing things or unless you can check and see what
messages are sent to your form when it tries to close you...

Paul T.

"Andrew Nugged" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> When I am teach my small tool to sit as NotifyIcon and make my main
> window this.Hide() it's all okay - but when I popped up again, and
> window is active and I ask some other programs to close all programs
> (and also Settings->Memory->Running programs->Stop All->EndTask) my
> program is killed... But I don't want to - I want it to hide window on
> this and still be in tray...
>
> and, by the way - after killing program there's empty icon place in
> tray are still busy and when I am running my program again - icon
> appears next to this empty but busy place... and those places are
> cleared only, of course, after reset...
>
> Please advice me...
>



 
Reply With Quote
 
Andrew Nugged
Guest
Posts: n/a
 
      9th May 2005
yes, on close message my program follows this.close() and other steps
and minimizing byself with this.Hide() and returns Cancel event, but,
for example, SPB Pocket Plus tries to close and see so app is minimized
and then do gracefull, peaceful, freindly, mmm... killing...

Anyway - if such kill is unavoided, how correctly to take back
NotifyIcon from tray& (to be correct: only that's icon empy but busy
space, icon image byselfs goes out from memory with app as resourse)..

Cause after such killing when I run my app again - it's icon appears on
one empty place to left in tray ("lost" empty space from previous
kill)...

Any suggestions?

 
Reply With Quote
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      9th May 2005
When your application exits, it should remove the task bar icon. Without
knowing how you are adding it, exactly, I can't tell you how to remove it.
If spb Pocket Plus is using TerminateProcess(), I don't know of any way to
clean up after that. You might try a Finally clause in a Try block in the
Main routine of your application or something of that sort...

Paul T.

"Andrew Nugged" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> yes, on close message my program follows this.close() and other steps
> and minimizing byself with this.Hide() and returns Cancel event, but,
> for example, SPB Pocket Plus tries to close and see so app is minimized
> and then do gracefull, peaceful, freindly, mmm... killing...
>
> Anyway - if such kill is unavoided, how correctly to take back
> NotifyIcon from tray& (to be correct: only that's icon empy but busy
> space, icon image byselfs goes out from memory with app as resourse)..
>
> Cause after such killing when I run my app again - it's icon appears on
> one empty place to left in tray ("lost" empty space from previous
> kill)...
>
> Any suggestions?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to avoid killing a win process Alb Windows XP Customization 3 23rd Dec 2005 08:43 PM
NotifyIcon Bug, Application.EnableVisualStyles, Application.DoEvents, and Memory Leaks Michael S. Malley Microsoft C# .NET 0 11th Mar 2004 08:43 PM
NotifyIcon Bug, Application.EnableVisualStyles, Application.DoEvents, and Memory Leaks Michael S. Malley Microsoft VB .NET 0 11th Mar 2004 06:22 PM
NotifyIcon Bug, Application.EnableVisualStyles, Application.DoEvents, and Memory Leaks Michael S. Malley Microsoft Dot NET Framework Forms 0 10th Mar 2004 09:52 PM
NotifyIcon Bug, Application.EnableVisualStyles, Application.DoEvents, and Memory Leaks Michael S. Malley Microsoft VB .NET 0 10th Mar 2004 09:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:34 PM.