window下命令
powercfg /change "Home/Office Desk" /moniter-timeout-ac 1
C#中实现
[DllImportAttribute("user32.dll")]
SendMessage(IntPtr hWnd, uint msg, uint wParam, int lParam)
private const uint WM_SYSCOMMAND = 0x0112;
private const uint SC_MONITORPOWER = 0xF170;
SendMessage(this.Handle,WM_SYSCOMMAND , SC_MONITORPOWER,2);
SendMessage(this.Handle,WM_SYSCOMMAND , SC_MONITORPOWER,-1);
关闭显示器API及命令
最新推荐文章于 2021-07-14 23:06:35 发布