![]() |
|
#2
|
|||
|
|||
|
For those who are curious about the batch file or the command, here it is:
Code:
cmd /c "powershell.exe -Command "(Add-Type '[DllImport(\"user32.dll\")]public static extern int SendMessage(int hWnd,int hMsg,int wParam,int lParam);' -Name a -Pas)::SendMessage(-1,0x0112,0xF170,2)"" Here is a short explanation of the code: The SendMessage function is imported from the User32.dll library. The function is called with the following parameter codes 0x0112 and 0xF170,2. They are: WM_SYSCOMMAND (0x0112) which is sending messages to the Windows System Command to the windows application and 0xF170 is the type of System command SC_MONITORPOWER in this case. Code:
SC_MONITORPOWER 0xF170 Sets the state of the display. This command supports devices that have power-saving features, such as a battery-powered personal computer. The lParam parameter can have the following values: -1 (the display is powering on) 1 (the display is going to low power) 2 (the display is being shut off) Code:
hxxps://learn.microsoft.com/en-us/windows/win32/menurc/wm-syscommand |
| The Following User Gave Reputation+1 to foosaa For This Useful Post: | ||
blue_devil (11-15-2023) | ||
| Thread Tools | |
| Display Modes | |
|
|