This tutorial will show you how to add a Turn off display desktop context menu that will let users Turn off display or Lock computer and Turn off display on demand in Windows 10 and Windows 11.
By default, You can specify a screen timeout for how long the PC sits inactive without user activity before all connected displays automatically turn off.
When your display turns off, you would just need to move the mouse, touch the touchpad or touchscreen, click a mouse or touchpad button, or press a key for the display(s) to turn back on.
There may be times when you would like to turn off the display or lock computer and turn off display on demand instead.
While you must be signed in as an administrator to add or remove the "Turn off display" context menu, all users will be able to use the context menu.
Using this context menu will leave a command prompt window open that you will need to manually close when you resume.
Contents
- Option One: Add "Turn off display" to Desktop Context Menu
- Option Two: Remove "Turn off display" from Desktop Context Menu
EXAMPLE: "Turn off display" desktop context menu
It is required to click/tap on Show more options first by default, then click/tap on Turn off display.
1 Click/tap on the Download button below to download the REG file below.
Add_Turn_off_display_to_desktop_context_menu.reg
Download
(Contents of REG file for reference)
Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\TurnOffDisplay]
"Icon"="imageres.dll,-109"
"MUIVerb"="Turn off display"
"Position"="Bottom"
"SubCommands"=""
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\TurnOffDisplay\shell]
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\TurnOffDisplay\shell\01menu]
"Icon"="powercpl.dll,-513"
"MUIVerb"="Turn off display"
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\TurnOffDisplay\shell\01menu\command]
@="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)\"\""
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\TurnOffDisplay\shell\02menu]
"MUIVerb"="Lock computer and Turn off display"
"CommandFlags"=dword:00000020
"Icon"="imageres.dll,-59"
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\TurnOffDisplay\shell\02menu\command]
@="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)\" & rundll32.exe user32.dll, LockWorkStation\""
2 Save the .reg file to your desktop.
3 Double click/tap on the downloaded .reg file to merge it.
4 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.
5 You can now delete the downloaded .reg file if you like.
1 Click/tap on the Download button below to download the REG file below.
Remove_Turn_off_display_from_desktop_context_menu.reg
Download
(Contents of REG file for reference)
Code:
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\DesktopBackground\Shell\TurnOffDisplay]
2 Save the .reg file to your desktop.
3 Double click/tap on the downloaded .reg file to merge it.
4 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.
5 You can now delete the downloaded .reg file if you like.
That's it,
Shawn Brink
Attachments
Last edited: