M
Matt Young
Problem: I need to save data before my application is closed by the OS or
another application (killing my app).
The two main scenarios I'm thinking about are,
1. The user navigates to Settings -> System tab -> Memory -> Running
Programs and stops my app (PPC 2003)
2. The user navigates to a utility program like the Dell Switcher Bar (free
with Dell Axims) and stops my app
Currently, I determine when the OS is killing my app (Memory -> Running
Programs and stop) by tracking when all my forms are 'deactivated'. When the
Form.Closing event fires for any form it calls a method which checks if all
the forms are 'deactivated' and if so, it closes my app. This had worked
well, until .
When the user navigates to an application like the Dell Switcher Bar (which
is accessible as a drop down menu like the start menu), the deactivated
event on my form doesn't fire. So when the user asks the Switcher Bar to
kill my app, my application thinks the form 'ok' button was clicked and
closes that form, leaving the application running. Then a warning screen
appears indicating that my application is no longer responding and . the
user has the option to 'kill it' and the application data I need to save is
lost.
Is there any way to determine if another process is killing my app? Any
ideas or suggestions?
Related: I tried using the
OpenNET.Windows.Forms.ApplicationEx.ApplicationExit (v1.1) event but my
attached method never fired.
Thanks!
another application (killing my app).
The two main scenarios I'm thinking about are,
1. The user navigates to Settings -> System tab -> Memory -> Running
Programs and stops my app (PPC 2003)
2. The user navigates to a utility program like the Dell Switcher Bar (free
with Dell Axims) and stops my app
Currently, I determine when the OS is killing my app (Memory -> Running
Programs and stop) by tracking when all my forms are 'deactivated'. When the
Form.Closing event fires for any form it calls a method which checks if all
the forms are 'deactivated' and if so, it closes my app. This had worked
well, until .
When the user navigates to an application like the Dell Switcher Bar (which
is accessible as a drop down menu like the start menu), the deactivated
event on my form doesn't fire. So when the user asks the Switcher Bar to
kill my app, my application thinks the form 'ok' button was clicked and
closes that form, leaving the application running. Then a warning screen
appears indicating that my application is no longer responding and . the
user has the option to 'kill it' and the application data I need to save is
lost.
Is there any way to determine if another process is killing my app? Any
ideas or suggestions?
Related: I tried using the
OpenNET.Windows.Forms.ApplicationEx.ApplicationExit (v1.1) event but my
attached method never fired.
Thanks!