VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



If a users attempts to shutdown/restart their computer while your application is still running, thi

by Roderick Thompson (12 Submissions)
Category: Encryption
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 1st March 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

If a users attempts to shutdown/restart their computer while your application is still running, this simple piece of code will actually allow

API Declarations


Declare Function AbortSystemShutdown Lib "advapi32.dll" Alias "AbortSystemShutdownA" (ByVal lpMachineName As String) As Long

Function GetName()
Dim lpBuff As String * 25
Dim ret As Long, ComputerName As String

ret = GetComputerName(lpBuff, 25)
ComputerName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)

GetName = ComputerName
End Function

Rate If a users attempts to shutdown/restart their computer while your application is still running, thi



    AbortSystemShutdown (GetName)
End Sub

Download this snippet    Add to My Saved Code

If a users attempts to shutdown/restart their computer while your application is still running, thi Comments

No comments have been posted about If a users attempts to shutdown/restart their computer while your application is still running, thi. Why not be the first to post a comment about If a users attempts to shutdown/restart their computer while your application is still running, thi.

Post your comment

Subject:
Message:
0/1000 characters