|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
preventing windows form shutting down
Is there a way to prevent windows from shutting down or restarting with vb?
(For example, I made a program that people nee dto log into and I dont want them to reboot if they havnt logged off) |
|
#2
|
|||
|
|||
|
When Windows is about to shut down, it sends a WM_QueryEndSession to all open applications. To detect (and prevent shutdown), we must define a message handler to this message.This is a delphi implement:http://delphi.about.com/cs/adptips2...bltip0500_4.htm
|
|
#3
|
|||
|
|||
|
delphi? I though this is the VB forum?
|
|
#4
|
|||
|
|||
|
U can read this code and learn how to prevent the pc from shutting down via handle the message..
|
|
#5
|
|||
|
|||
|
U can try to add this code in the form's unload event:
Private Sub Form_Unload(Cancel As Integer) cancel=1 End Sub |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > preventing windows form shutting down |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|