Skip to content

Commit 82cdfe6

Browse files
authored
Update WinNUT.vb
1 parent 8ab11a5 commit 82cdfe6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

WinNUT_V2/WinNUT_GUI/WinNUT.vb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Public Class WinNUT
100100
Private Event On_Line()
101101
Private Event UpdateNotifyIconStr(ByVal Reason As String, ByVal Message As String)
102102
Private Event UpdateBatteryState(ByVal Reason As String)
103-
Declare Function SetSystemPowerState Lib "kernel32" (ByVal fSuspend As Integer, ByVal fForce As Integer) As Integer
103+
Declare Function SetSuspendState Lib "PowrProf" (ByVal Hibernate As Integer, ByVal ForceCritical As Integer, ByVal DisableWakeEvent As Integer) As Integer
104104

105105
Public Property UpdateMethod() As String
106106
Get
@@ -980,9 +980,9 @@ Public Class WinNUT
980980
Case 0
981981
Process.Start("C:\WINDOWS\system32\Shutdown.exe", "-f -s -t 0")
982982
Case 1
983-
SetSystemPowerState(True, 0)
983+
SetSuspendState(False, False, True) 'Suspend
984984
Case 2
985-
SetSystemPowerState(False, 0)
985+
SetSuspendState(True, False, True) 'Hibernate
986986
End Select
987987
End Sub
988988

0 commit comments

Comments
 (0)