Re: how to find app termination event?



On Sat, 4 Jun 2005 02:49:01 -0700, "=?Utf-8?B?U2FjaGluX00=?="
<SachinM@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

>Hi,
>
>I've developed an application in vb 6.0, which logs some events into
>windows event log. My application does not have any GUI like forms
>instead the user can run it from command line with some parameters.
>(command line arguments)
>The end user is going to configure it with Task Schedular.
>My problem is to trap any End Task event,
>How to do it in vb6.0? any API which detects termination,
>system shutdown?

>In all, the real problem is the app should ideally report an event
>into event log before its own termination, shutdown (End Task by the user).

Create a dummy Class and use its Terminate Event to do what you want

Alternatively, if your App just runs from Sub Main then ...

Ah ... you want to make sure the log is committed
- under a forced closedown

Try looking at it the other way round, look at the Log (or anything
else) to determine whether the last task did /not/ terminate properly.
.



Relevant Pages

  • Re: how to find app termination event?
    ... the real problem is the app should ideally report an event ... > into event log before its own termination, ...
    (microsoft.public.vb.winapi)
  • Re: What does kernel do when it receives the SIGKILL
    ... As I know, SIGKILL is performed by linux kernel that kill the app, what ... means to discard that file descriptor object. ... So if process termination failed to close files, ...
    (comp.os.linux.development.system)
  • Service starts interactive application
    ... I've made a NT service which can launch interactive apps on selectable ... finally launches the app on that desktop. ... terminated it sends WM_Close to the app, waits for its termination, ... removes the ACEs from Winsta0 and Default and terminates itself. ...
    (microsoft.public.win32.programmer.ui)
  • Re: catch the process terminate from the task manager
    ... aha well you can`t catch the termination of your app when it is killed ... as the app is forcefully killed (equivalant as your app is ended with the ... if you End Process in the Processes tab of Task Manager. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How do I stop this thing?
    ... In most real-world scenerios your applications should be prepared for graceful terminations, if possible, in all situations. ... other words, you want your app to have a chance to save settings, perform proper clean-up, etc. before exiting. ... I don't believe that Application.Exitis an immediate termination, ...
    (microsoft.public.dotnet.languages.csharp)