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
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