锁屏
相当于按下Win+L
键。
LockWorkStation();
关闭屏幕
::SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM)2);
https://docs.microsoft.com/en-us/windows/win32/menurc/wm-syscommand
- -1 (the display is powering on)
- 1 (the display is going to low power)
- 2 (the display is being shut off)