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);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2022-01-28
  • 2021-05-27
  • 2021-12-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案