Re: Notification of WIndows Shutdown.
- From: PeterD <peter2@xxxxxxxxxx>
- Date: Sat, 05 Jan 2008 13:59:54 -0500
On Fri, 4 Jan 2008 13:14:57 -0800, "Bob Butler" <noway@xxxxxxxxxxx>
wrote:
"Mike Williams" <mike@xxxxxxxxxxxxxxxxx> wrote in message
news:OyK53YxTIHA.4532@xxxxxxxxxxxxxxxxxxxxxxx
"PeterD" <peter2@xxxxxxxxxx> wrote in message
news:4o6tn3lfkgo2sl3je478hug3ka9a7aqsod@xxxxxxxxxx
Any easy VB6 way to trap a Windows shutdown? I tried the
unload functions for the form, but they don't reflect (or my test
didn't show it) that it was a Windows shutdown and not an
application derived shutdown.
Have you tried checking the UnloadMode parameter in the Form's QueryUnload
event? Here are the values:
0 The user chose the Close command from the Control menu on the form.
1 The Unload statement is invoked from code.
2 The current Microsoft Windows operating environment session is ending.
3 The Microsoft Windows Task Manager is closing the application.
4 An MDI child form is closing because the MDI form is closing.
5 A form is closing because its owner is closing.
I think the problem here is that #2 doesn't differentiate between Logoff and
Shutdown. I remember looking into this a long time ago and not finding any
solution to it.
I'm not sure I care if it does, but my application doesn't have a form
so trapping QueryUnload is not working as I want. I put in a dummy
form (loaded, but kept invisible) but the only notification it gets is
that it is 'invoked from code'.
.
- References:
- Notification of WIndows Shutdown.
- From: PeterD
- Re: Notification of WIndows Shutdown.
- From: Mike Williams
- Re: Notification of WIndows Shutdown.
- From: Bob Butler
- Notification of WIndows Shutdown.
- Prev by Date: Re: Notification of WIndows Shutdown.
- Next by Date: Re: Still BitBlit/ GDI question...
- Previous by thread: Re: Notification of WIndows Shutdown.
- Next by thread: Re: Notification of WIndows Shutdown.
- Index(es):
Relevant Pages
|