|
-
Oct 7th, 2001, 11:12 PM
#1
Thread Starter
Member
How to detect windows Shutdown???
Hey guys,
see if u can help me on this one?
i want to detect windows shutdown.....is there any API to do this?
the thing is i want my application to write to a log file everytime the windows shutsdown......
all help is greatly appiciated........
Thanx
Amprat
Msg for Gibbo : dude i am still working on that IE Problem ....will let u know what i find out!!! cheers
-
Oct 8th, 2001, 01:14 AM
#2
No need for API.
VB Code:
Private Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
If UnloadMode = 2 Then
Msgbox "Windows is shutting down"
End If
End Sub
-
Oct 9th, 2001, 07:30 AM
#3
New Member
hi
u can do this from sysinfo object
-
Oct 9th, 2001, 07:50 AM
#4
PowerPoster
no no no, that code is placed in the unload event of a form. When Windows shutsdown, it attempts to close everything, including your forms. If you have that code, it will display the message box when you shutdown windows.
-
Oct 11th, 2001, 01:27 AM
#5
Thread Starter
Member
i tried to put the Form_queryunload code as suggested by mathew gates but it does not work....i donno why but the unloadmode never becomes 2???
please help with ode ...if possible!
Regards
Amprat
-
Oct 11th, 2001, 03:48 AM
#6
PowerPoster
not sure this is going to help, but try changing 2 to vbAppWindows
-
Oct 11th, 2001, 04:02 AM
#7
PowerPoster
You might not get the response in case of Forced Shutdown.
-
Oct 11th, 2001, 11:40 PM
#8
Thread Starter
Member
So what's the solution to detect shutdown?????
Please Suggest!
Regards
Amprat
-
Oct 12th, 2001, 08:54 AM
#9
PowerPoster
Subclass your main form and look for the WM_QUERYENDSESSION
message. This is what the systems sends while shutting down the system
-
Oct 12th, 2001, 11:50 AM
#10
Originally posted by amitabh
You might not get the response in case of Forced Shutdown.
Most of the time, I believe you will get the Msgbox, but even if OK is there, it will close the Msgbox automatically.
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
|