Download and install AutoHotKey (AHK further) program.
(no any other programs needed).
Copy following AHK script and paste it to Notepad
then save file as Display-Off.ahk
.
(Make sure to choose "All files" in Notepad's "Save" dialog
when you saving file, otherwise file will be saved as Display-Off.ahk.txt
)
#m::
Sleep 1000
SendMessage, 0x112, 0xF170, 2,, Program Manager
Return
Double click on the Display-Off.ahk
saved AHK script and you done.
If you press after that Win+m key's combination you will turn display off.
If you want another hot key combinations then modify first line of AHK scrip as you liked (AutoHotKey comes with chm
help file that describes all its feature)
To turn display on, just move mouse or make a mouse click or press any key on keyboard
P.S.
If you don't want to use (IMO pretty good program ) AHK program I mentioned, then download nircmd zip archive, make a right click on this zip file and choose "Properties" from pop up menu, then in the right bottom corner click on "Unblock" button then press "Ok" and unpack nircmd.exe
file from archive.
Now, create shortcut to nircmd.exe
(make a right click on nircmd.exe
and select "Create shortcut") program and in the field target
put following string
C:\path\to\nircmd.exe cmdwait 1000 monitor off
and in the field Shortcut key
press those combination of keys that you like to turn display off. When you saved shortcut you may press chosen hot keys any time to fire up this shortcut
To compare to AutoHotKey program, creation of hot keys in shortcuts is limited, so make sure you not overriding already in use hot key's combinations.
Original answer before OP clarified that instead of shutdown he wants to turn display off only:
If you would use AutoHotKey (AHK further) program, all you need is to create AHK script like this:
#c::
Run, shutdown.exe -s -t 00
Return
Then when you run AHK and press Win+c key combination
Windows will shutdown itself.
What do you mean by "window"? I am guessing that you mean the LCD screen. In which case you probably can just close the lid and it will turn the display off. (If you got that ultra annoying setting which sleeps your laptop when the lid closes, then you can fix that from control panels power options). – Hennes – 2017-02-12T10:23:53.113
@Hennes yes I mean the LCD screen. If I do this, my laptop will go standbye, I have already tried changing advanced settings there and it doesn't seem to help : / – cnmesr – 2017-02-12T10:26:31.433
Not sure if lenovo has it but on my dell I can hit fn + b to enable lights out mode. It turns all light and sound off. I think I had to enable it in the bios though. – birdman3131 – 2017-02-12T11:17:30.047
Request for someone to remove the choice of this as answer because I asked same question and got marked as a duplicate... – Ahmed – 2018-09-20T03:41:52.397