Last active
February 13, 2025 15:37
-
-
Save EugeneLoy/150044d04b08e35d09e164c864e78da7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::PostMessage(-1,0x0112,0xF170,2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems like this is an issue with modern standby modes. When you turn the monitor off in this way it puts the entire machine into sleep mode. I'm guessing that this only happens on devices such as laptops.
There is a stack overflow post here discussing it, and offering some recommendations for alternative API's you can call to resolve