一键关屏(锁屏)小工具

文章正文
发布时间:2025-10-06 18:45

[Asm] 纯文本查看 复制代码

cmd.exe /c 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)


[Asm] 纯文本查看 复制代码

cmd.exe /C powershell (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)




注册表

[Asm] 纯文本查看 复制代码

Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Item23] "MUIVerb"="一键熄屏(PostMessage)(&Z)" "Icon"="%SystemRoot%\\System32\\shell32.dll,174" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Item23\command] @="cmd.exe /c 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)"





[Asm] 纯文本查看 复制代码

Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Item24] "MUIVerb"="一键熄屏(SendMessage)" "Icon"="%SystemRoot%\\System32\\shell32.dll,174" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Item24\command] @="cmd.exe /C powershell (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)"




一键熄屏(SendMessage):

一键熄屏(PostMessage)(&Z):