I had been using RedmondPies Turn Off LCD utility in a batch file to turn off my laptops LCD display *and* lock Windows for quite sometime. But it was still a lotta work to run the batch file every time I wanted to lock windows. So I went ahead and wrote this tiny Autohotkey script to automatically turn off the display when I lock Windows using the Win+L key combination.

My ZzzLCD utility turns off the monitor when you Press Win+L to lock Windows.

ZzzLCD

ZzzLCD – Auto LCD Turn off

ZzzLCD is a tiny Autohotkey script containing the following code:

#NoEnv
#NoTrayIcon
SendMode Input
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#l::
Run,%A_WinDir%\System32\rundll32.exe user32.dll`,LockWorkStation
Sleep 1500
SendMessage 0x112, 0xF170, 2,,Program Manager

You can paste the above code in notepad, save it as a .ahk file and compile it yourself.

OR

You can download the pre-compiled ZzzLCD.exe.

Download ZzzLCD.exe


Start Up with Windows

If you want to have ZzzLCD startup with Windows on every reboot, perform the following steps:

  1. Right click on ZzzLCD.exe and create a shortcut.
  2. Go to Run (Win+R), type %appdata% and press Enter.
  3. In the folder that opens up, browse to Microsoft\Windows\Start Menu\Programs\Startup
  4. Copy paste the shortcut that you created in step 1 inside the Startup folder.

Done. Now ZzzLCD will run every time Windows starts up. :)

Please leave a comment if you have any suggestions. :D

You may also like to read:
  1. Turn Off Monitor AND Lock Windows with one click
  2. Dell Studio 1555 Numpad Solution with AutoHotKey
  3. How to use an AHK Autohotkey script
  4. 7 Taskbar Tweaker – Windows 7 taskbar simplified.