I recently upgraded my trusty ThinkPad T42 to Windows 7. Unfortunately, the screen-off keystroke no longer works. Some quick Googling showed that people made their own handlers in C#. Well, that sucks if you don’t have the .net CLR. This is not a problem on Windows 7, but I also wanted to try out my Assembly skills since they were all just calling standard Win32 APIs.
This should work on fairly old systems, back to Windows NT 3.1 and Windows 95, unlike the C# versions. It is also 7.5kb vs 85kb.
I wrote it in MASM using the Irvine library for convenience. Optimized with http://upx.sourceforge.net/
TITLE Monitor Off (main.asm) ; Description: This program turns off your monitor (power saving mode) ; Revision date: 2 November 2009 INCLUDE Irvine32.inc INCLUDELIB Kernel32.lib INCLUDELIB User32.lib SendMessageA PROTO :DWORD,:DWORD,:DWORD,:DWORD GetConsoleWindow PROTO WM_SYSCOMMAND = 0112h SC_MONITORPOWER = 0F170h OFF = 2 .data msg BYTE "Monitor off. Program from Kev009.com",0dh,0ah,0 .code main PROC call Clrscr ; Get our window handle to send the event to INVOKE GetConsoleWindow ; The handle is now in eax INVOKE SendMessageA, eax, WM_SYSCOMMAND, SC_MONITORPOWER, OFF mov edx,OFFSET msg call WriteString exit main ENDP END main
I’ve set up a project page at http://www.kev009.com/wp/projects/lcdoff/ if there ever need to be updates.
Related posts:
- LCDoff.exe This program will disable your LCD or monitor when executed. ...
- Linus and Windows 7 This is awesome....
- Windows 7 has definite backlight problems (“Black Screen of Death”) There is definitely a problem in Windows 7 RTM with...
- Video of Windows 7 Black Screen of Death Here’s a video to accompany my previous blog post Windows...


















Hey Kevin, thank you for your comment, I really appreciate it. I’ve answered to it.
Greetings.
Pingback: Windows 7 has definite backlight problems (”Black Screen of Death”) | Kev009.com
Thanks for the program, it works great!
LCDoff is the best smallest utility that works best, even with Windows 7, and Thinkpad with Extended monitor via docking station.
Cheers!
Works like a charm. Nice job!
26% power savings:
My thinkpad z60m is 30 watts at idle with screen on
and 22 watts with the screen off.