Created
March 17, 2018 09:50
-
-
Save Y-Koji/7b8a2b6a049013c0f5419b5363c9dd91 to your computer and use it in GitHub Desktop.
ノートPCのディスプレイ電源を切るプログラム
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 <stdio.h> | |
#include <windows.h> | |
#include <winuser.h> | |
#pragma comment(lib, "user32.lib") | |
#define DISPLAY_ON (-1) | |
#define DISPLAY_OFF (2) | |
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) | |
{ | |
PostMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, DISPLAY_OFF); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
コンパイル済みバイナリは以下
https://www.dropbox.com/s/vmt47gr5eqpj13i/display_off.exe?dl=0