LCDoff.exe

This program will disable your LCD or monitor when executed.  Useful for conserving battery, screen life, and privacy.  Very handy for overriding software that blocks the automatic screen powerdown (like Synergy).

Download LCDOff.exe

It should work on fairly old systems, back to Windows NT 3.1 and Windows 95, unlike the C# versions elsewhere. It is also 7.5kb vs 85kb.

I wrote it in MASM using the Irvine library for convenience. Optimized with http://upx.sourceforge.net/

Rational:

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.

Source Code:

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
Be Sociable, Share!
  • email
  • Reddit
  • HackerNews

9 thoughts on “LCDoff.exe

  1. Pingback: Turn Windows Monitor/LCD Off (Assembly Language Version) — Announcing LCDoff | Kev009.com

  2. CUnknown

    Hi,

    I was using the LCDOff.exe and it worked like a charm on my windows 7 system. I placed it in the desktop folder and created a keyboard shortcut for it. Unfortunately, today, my virus scanner detected a trojan with the same filename found in a folder
    with the same name in Program Files (86).

    Trojaans paard Generic29.COFW, c:\Program Files (x86)\LCDoff\LCDoff.exe;”Verplaatst naar de quarantaine”;”19-10-2012, 23:24:35″;”Bestand of map”;”"

    I most certainly did not place the executable in that folder, and as far as I understand the source code that you have posted here, there is no file creation. So how could you explain the positive match for the trojan signature?

  3. Michael F

    My anti-virus software also detects this program as a “Generic29.COFW” type Trojan. I don’t believe it is or is intended to be malware, and I scanned it at an online URL site and it gave no negative results. Don’t know what’s up.

  4. Shankar Easwaran

    Which Antivirus solution are you using ? I am not facing any issues with using NAV on my box.

    I think it might be the NAV thats not liking the way its compressed by using upx.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>