mirror of
https://github.com/stasenso/Puer.git
synced 2026-06-26 21:32:42 +03:00
Add call to SetThreadExecutionState to prevent the system from entering sleep mode during execution.
This commit is contained in:
Binary file not shown.
+9
-2
@@ -41,10 +41,17 @@ WinMain endp
|
||||
WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
|
||||
LOCAL hDC:HDC
|
||||
.if uMsg==WM_DESTROY ; если пользователь закpывает окно
|
||||
invoke SetThreadExecutionState,ES_CONTINUOUS
|
||||
invoke PostQuitMessage,NULL ; выходим из пpогpаммы
|
||||
.elseif uMsg==WM_CREATE
|
||||
|
||||
|
||||
;Запрещаем переход в сон и отключение дисплея
|
||||
invoke SetThreadExecutionState,ES_CONTINUOUS or ES_SYSTEM_REQUIRED or ES_DISPLAY_REQUIRED
|
||||
.if rax ==-1
|
||||
invoke PostQuitMessage,NULL ; выходим из пpогpаммы
|
||||
.else
|
||||
mov rax,0
|
||||
ret
|
||||
.endif
|
||||
|
||||
.elseif uMsg==WM_PAINT
|
||||
invoke myPaint,hWnd
|
||||
|
||||
Reference in New Issue
Block a user