Discussion:
kill event
(too old to reply)
David Becker
2004-01-28 09:41:24 UTC
Permalink
is there a way to receive an event in a vb app when it is quitted by the
task manager or when the system is going down?

thanks, david
Paul W
2004-02-07 01:50:54 UTC
Permalink
Post by David Becker
is there a way to receive an event in a vb app when it is quitted by the
task manager or when the system is going down?
thanks, david
In the Form_QueryUnload event, check the UnloadMode parameter, it will
have one of the following values:

vbFormControlMenu - 0 = The user chose the Close command from the
Control menu on the form.

vbFormCode - 1 = The Unload statement is invoked from code.

vbAppWindows - 2 = The current Microsoft Windows operating environment
session is ending.

vbAppTaskManager - 3 = The Microsoft Windows Task Manager is closing
the application.

vbFormMDIForm - 4 = An MDI child form is closing because the MDI form
is closing.

vbFormOwner - 5 = A form is closing because its owner is closing.
Continue reading on narkive:
Loading...