123456789101112131415 |
- using System.Runtime.InteropServices;
- namespace TurnoffMonitorOnLock.MonitorPowerApi
- {
- internal static class MonitorPower
- {
- [DllImport("user32.dll")]
- private static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);
- public static void SetMonitorInState(MonitorState state)
- {
- PostMessage(0xFFFF, 0x112, 0xF170, (int)state);
- }
- }
- }
|