C0D3 MA5T3R Homepage

Shutdown Blocker

Code to block user shutdown attempts of the program / computer

(See Below Code)

'Whenever the Windows 'Shutdown' command tries to close this program,
'it will immediately cancel the operation, aborting the shutdown.
Private Sub Form_Unload(Cancel As Integer)
'
'Set Cancel to 1 (i.e. Cancel the shutdown operation
Cancel = 1
End Sub

(Copy and Paste this code into your Visual Basic project)

*Want to join the C0D3 MA5T3R e-mail list?*

Get all the latest code news and articles, and even submit your own.

You can sign-up for free below (you may opt-out at any time):

Join the mailing list
Enter your name and email address:
Name:
Email:  
Subscribe      Unsubscribe