|
-
Oct 30th, 2002, 01:25 PM
#1
Thread Starter
Addicted Member
can my app know that windows is shutting down?
My application has an "Are you sure...?" prompt in "Form_QueryUnload".
The trouble with this is if windows is shutting down, this prompt gets in the way.
Can I detect that windows is shutting down so that I can remove this prompt from the procedure?
This must work on both win2k and win98.
Thanks,
John
-
Oct 30th, 2002, 01:29 PM
#2
Hyperactive Member
Check if UnloadMode = vbAppWindows
And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.
-
Oct 30th, 2002, 01:56 PM
#3
Use The One brenaaro suggested for this instance...
but, for future reference, here are all the unloadmodes available.
VB Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'there are 5 unloadmode levels
Select Case UnloadMode
Case vbFormControlMenu 'UnloadMode 0
'form is being unloaded via the Close
'or by hitting the X in the upper right hand corner
'command from the System menu
Case vbFormCode 'UnloadMode 1
'Unload Me has been issued from code
Case vbAppWindows 'UnloadMode 2
'Windows itself is closing
Case vbAppTaskManager 'UnloadMode 3
'the Task Manager is closing the app
Case vbFormMDIForm 'UnloadMod 4
'an MDI child form is closing because
'its parent form is closing
End Select
End Sub
-
Oct 30th, 2002, 04:27 PM
#4
Thread Starter
Addicted Member
Check if UnloadMode = vbAppWindows
that did it.
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|