Which Events on a System Shutdown or Forced End 
Author Message
 Which Events on a System Shutdown or Forced End

Which events are triggered by a Restart" or Shutdown"  from the start
button, or the End Task command from the task list displayed after a
Cntl-Alt-Delete?  I am trying to make sure that I properly close out files,
databases and such from a VB application

Thanks

Dan



Wed, 18 Jun 1902 08:00:00 GMT  
 Which Events on a System Shutdown or Forced End

Quote:

> Which events are triggered by a Restart" or Shutdown"  from the start
> button, or the End Task command from the task list displayed after a
> Cntl-Alt-Delete?  I am trying to make sure that I properly close out
> files, databases and such from a VB application

Dan,

You want to put some code in QueryUnload event the your object (object
as in the form or control you are writing).

Specifically, you want to look at the UnloadMode parameter that is
being passed to the event.  This param will tell you how the program is
being closed down.  As per the MSDN docs the possible options are:

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.

So, you can write you program to react to the specific situations that
your program might encounter.  I hope this helps.

Dan G

Sent via Deja.com http://www.deja.com/
Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Receiving a system shutdown event in vb?

2. Excel events (need shutdown event)???

3. How to force window shutdown ?

4. sub end- / function end event

5. How to force windows shutdown ?

6. How to force a shutdown ???????

7. Winnt force shutdown

8. ExitWindowsEx - FORCE vs SHUTDOWN

9. Forced Windows Shutdown

10. Forcing a shutdown from 95

11. Forcing Access to wait the end of an application started by SHELL

12. Force OleDrag to end

 

 
Powered by phpBB® Forum Software