관리 메뉴

안까먹을라고 쓰는 블로그

[C#] 모니터 ON/OFF 제어 본문

WIN API

[C#] 모니터 ON/OFF 제어

YawnsDuzin 2012. 10. 30. 13:02

 

반응형

using System.Runtime.InteropServices; const int WM_SYSCOMMAND = 0x0112; const int SC_MONITORPOWER = 0xF170; const int MONITOR_ON = -1; const int MONITOR_OFF = 2; const int MONITOR_STANBY = 1; [DllImport("user32.dll")] private static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam); // Monitor On SendMessage(this.Handle.ToInt32(), WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_ON); // Monitor Off SendMessage(this.Handle.ToInt32(), WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF);


반응형
Comments