Last active
September 22, 2016 12:36
-
-
Save informationsea/582d0104b095290d749a83b8781d2741 to your computer and use it in GitHub Desktop.
Lock windows and sleep display
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> | |
int main() | |
{ | |
/* https://msdn.microsoft.com/en-us/library/windows/desktop/aa376869(v=vs.85).aspx */ | |
LockWorkStation(); | |
/* https://msdn.microsoft.com/en-us/library/windows/desktop/ms644944(v=vs.85).aspx */ | |
PostMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment