Created
December 12, 2022 03:07
-
-
Save shellster/465a90eeb5e3ad41c64bf33a2a6f0a84 to your computer and use it in GitHub Desktop.
Script to prevent sleep / lock screen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
//cl /EHsc NeverGone.cpp | |
INT WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, INT nCmdShow) | |
{ | |
SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED); | |
while(true){ | |
Sleep(1000 * 60); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment