Skip to content

Instantly share code, notes, and snippets.

@JubbaSmail
Created November 13, 2014 09:57
Show Gist options
  • Save JubbaSmail/a9cb57c6db3000400112 to your computer and use it in GitHub Desktop.
Save JubbaSmail/a9cb57c6db3000400112 to your computer and use it in GitHub Desktop.
#include <windows.h>
#if define UNICODE
#define SendMessage SendMessageW
#else
#define SendMessage SendMessageA
#endif
void Dim_Display()
{
while (TRUE)
{
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2);
Sleep(20000);
}
}
int main(int argc, LPTSTR argv[])
{
Dim_Display();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment