Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Lock Computer and Turn Off Monitor - Add to Desktop Context Menu

18 Jul 2015   #10
Brink

64-bit Windows 10 Pro
 
 

Quote   Quote: Originally Posted by Akip View Post
Is there any way to only turn off the monitor without locking the computer?
Sure. You could use this below instead for that.

Turn Off Display - Add to Desktop Context Menu in Windows


My System SpecsSystem Spec
.
18 Jul 2015   #11
Akip

Windows 7 Home Premium 32bit
 
 

Quote   Quote: Originally Posted by Brink View Post
Quote   Quote: Originally Posted by Akip View Post
Is there any way to only turn off the monitor without locking the computer?
Sure. You could use this below instead for that.

Turn Off Display - Add to Desktop Context Menu in Windows
Thats what I looking for. Thanks Shawn
My System SpecsSystem Spec
18 Jul 2015   #12
Brink

64-bit Windows 10 Pro
 
 

You're most welcome.
My System SpecsSystem Spec
12 Sep 2015   #13
powershelluser

Windows 10 Education
 
 

Quote   Quote: Originally Posted by Akip View Post
Is there any way to only turn off the monitor without locking the computer?
You can turn off the monitor the workstation without a 3rd party program with a PowerShell-script: Make a MonitorOff.ps1 for example in C:\ and create a shortcut with this target: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy UnRestricted -File C:\MonitorOff.ps1

Paste the following code inside the .ps1 file:

Code:
# Turn display off by calling WindowsAPI.
 
# SendMessage(HWND_BROADCAST,WM_SYSCOMMAND, SC_MONITORPOWER, POWER_OFF)
# HWND_BROADCAST    0xffff
# WM_SYSCOMMAND    0x0112
# SC_MONITORPOWER    0xf170
# POWER_OFF          0x0002
 
Add-Type -TypeDefinition '
using System;
using System.Runtime.InteropServices;
 
namespace Utilities {
    public static class Display
    {
        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        private static extern IntPtr SendMessage(
            IntPtr hWnd,
            UInt32 Msg,
            IntPtr wParam,
            IntPtr lParam
        );
 
        public static void PowerOff ()
        {
            SendMessage(
                (IntPtr)0xffff, // HWND_BROADCAST
                0x0112,            // WM_SYSCOMMAND
                (IntPtr)0xf170, // SC_MONITORPOWER
                (IntPtr)0x0002  // POWER_OFF
            );
        }
    }
}
'
[Utilities.Display]::PowerOff()
 
 
if ($Host.Name -eq 'ConsoleHost') {Stop-Process $PID}
My System SpecsSystem Spec
.

17 Sep 2015   #14
SaraPalani

Windows 7
 
 

Can we use this in Windows 10 operating system.
My System SpecsSystem Spec
17 Sep 2015   #15
Brink

64-bit Windows 10 Pro
 
 

Hello Sara,

I haven't tested this in Windows 10 yet, but it should work.
My System SpecsSystem Spec
17 Sep 2015   #16
SaraPalani

Windows 7
 
 

I am going to use it on my Windows 10 PC. if it is work properly, I will post my experience here.
My System SpecsSystem Spec
Comment

 Lock Computer and Turn Off Monitor - Add to Desktop Context Menu




Tutorial Tools Search this Tutorial
Search this Tutorial:

Advanced Search




Similar help and support threads
Windows 7 Tutorial Category
Turn Aero On/Off Shortcut In Windows 7 Desktop Context Menu
hi all :D not sure if this method of adding a context menu short-cut for enable/disable aero has been posted i find it handy to use when i run the WEI test i toggle on/off to see performance difference (apologies if so). Please use the links below. on:ar: How To Add Turn Aero On Shortcut In...
Customization
Lock Computer - Add to Desktop Context Menu
How to Add "Lock Computer" to the Desktop Context Menu in Windows 7 This will show you how to add or remove Lock Computer to the desktop context menu in Vista and Windows 7. EXAMPLE: Lock Computer in Desktop Context Menu Here's How:
Tutorials
Cascading "My Computer" menu in desktop context menu
I recently switched from XP to Win7 x64. I've used Stardock RightClick for years to make a cascading "My Computer" menu in the desktop context menu. This is a very handy way to browse files and folders. I found the tutorial @sevenforums to make a shortcut to "My Computer", but I really like to make...
Customization
Add Computer Management to Desktop Context Menu
@ Mark: Hello. Nice to meet you. I know this is an old thread, but I wanted to keep my question based on your initial post or instruction. I stumbled upon this thread in my searching for this very issue. THANK YOU for your dedication and work with this issue and your solution!!! My...
Customization
Computer Management - Add to Desktop Context Menu
How to Add or Remove "Computer Management" to Desktop Context Menu This tutorial will allow you to add or remove Computer Management from the desktop context menu for all users in Vista, Windows 7, and Windows 8. You must be logged in as an administrator to be able to add or remove this...
Tutorials
Computer - Add or Remove from Desktop Context Menu
How to Add or Remove "Computer" Desktop Context Menu in Windows 7 and Windows 8 This tutorial will show you how to add or remove Computer from the desktop right click context menu for all users in Windows 7 and Windows 8. While, you will only be able to add or remove the "Computer" desktop...
Tutorials


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 00:21.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App