The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Manually turning display off

    Discussion in 'Alienware M11x' started by Deofol, Aug 11, 2010.

  1. Deofol

    Deofol Notebook Enthusiast

    Reputations:
    37
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    15
    Is there a hot key to turn the display off?

    If I queue up some music, I'd prefer to turn the display off to conserve battery.

    Thanks.
     
  2. corwinicre

    corwinicre Notebook Deity

    Reputations:
    191
    Messages:
    720
    Likes Received:
    0
    Trophy Points:
    30
    There isn't one by default, but it's easy enough to do.

    Follow this guide to create a clickable shortcut to turn off the monitor: Create a Shortcut to Turn Off the Monitor in Windows 7

    Then, to make it work by a key press instead of clicking the shortcut icon, right click on the shortcut, go to Properties, and set the Shortcut Key to whatever you want.
     
  3. slickie88

    slickie88 Master of Puppets

    Reputations:
    973
    Messages:
    2,566
    Likes Received:
    7
    Trophy Points:
    56
    Sweet. Thanks, corwincre.

    Can't rep you for a bit, but as soon as I can you got it.
     
  4. dperlman002

    dperlman002 Notebook Enthusiast

    Reputations:
    3
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    5
    Works great. F6 appears to be unused, so a perfect solution. Now I wish I had a "Alienware" style decal to put over the F6 button.

    Hope this saves some battery.

    Thanks!

    David
     
  5. slickie88

    slickie88 Master of Puppets

    Reputations:
    973
    Messages:
    2,566
    Likes Received:
    7
    Trophy Points:
    56
    Hmm... that's not quite what I needed it to do really as it will turn the monitor back on if there's any type of input. For my needs I was looking for something that would keep it off while I watch videos on my TV until I choose to have it turned back on.

    The Fn+F1 solution isn't ideal for my needs either. Every other laptop I've owned in the past 5 years has had a Fn key combo to turn off the LCD. Wish AW would add that feature...
     
  6. sprucejuice

    sprucejuice Notebook Enthusiast

    Reputations:
    0
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    15
    using nircmd to turn the monitor off I created a batch to run the appropriate command and added the shortcut to it. I bound that short cut to ctrl-alt-= and dropped the shortcut into the start menu so it works happily.

    After launching a game (in this case mass effect 2) the key binding doesn't respond. Native bindings like ctrl-alt-del still work obviously. Any ideas how I can get my binding to the shortcut to work ingame?

    Cheers,

    S
     
  7. Deofol

    Deofol Notebook Enthusiast

    Reputations:
    37
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    15
    None of these solutions really worked as simple as I wanted them too. I really wanted to take advantage of the FN key, but for the life of me I couldn't figure out how to capture the F6 after the FN key was depressed. (I later realized what was working on my dev laptop did not work on the Alienware, so just went with CTRL)

    So... You have to press CTRL+F6

    Download here; Alienware LCD Off

    Just place the exe in your startup folder and works like a charm.

    This is the code, if you prefer to build it yourself. Just set the window mode to minimized and show in task bar as false.

    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    using System.Runtime.InteropServices;
    
    namespace AlienwareLCDOFF
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private const int MONITOR_OFF = 2;
            private int SC_MONITORPOWER = 0xf170;
            private int WM_SYSCOMMAND = 0x112;
           
            [DllImport("user32.dll", SetLastError = true)]
            private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    
            [DllImport("user32.dll")]
            private static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);
    
            [DllImport("User32.dll")]
            private static extern short GetAsyncKeyState(System.Int32 vKey);
    
            public void TurnOffLCD()
            {
                int num = 0;
                num = SendMessage(FindWindow(null, null).ToInt32(), this.WM_SYSCOMMAND, this.SC_MONITORPOWER, 2);
            }
    
            private void timer1_Tick(object sender, EventArgs e)
            {
                if (GetAsyncKeyState(0x11) != 0 && GetAsyncKeyState(117) != 0)
                    TurnOffLCD();
            }
        }
    }
    Edit: New Build 3:30 CST: Refined the code, removed from ALT+Tab Application list. Consumes about 1/2 the memory as before.
     
  8. sprucejuice

    sprucejuice Notebook Enthusiast

    Reputations:
    0
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    15
    Deofol, how'd you bind that to F6? My F6 is currently bound to change graphics.
     
  9. Noah14

    Noah14 Notebook Evangelist

    Reputations:
    73
    Messages:
    620
    Likes Received:
    0
    Trophy Points:
    30
    He has an M11x R2 (core i5 or core i7)
    The M11x R2's have Nvidia Optimus, so there is no manual switch.
    In other words, the F6 key on the M11x R2 is blank.
     
  10. Deofol

    Deofol Notebook Enthusiast

    Reputations:
    37
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    15
    Its set to F6+FN now, I can make one bind to anything you want if you like. Control+F6 etc.

    Looking at the code, 255 is the FN key, 117 is F6.

    if (GetAsyncKeyState(255) != 0 && GetAsyncKeyState(117) != 0)

    Basically I'm checking if the state of the key is anything other than 0 (unpressed).
     
  11. Deofol

    Deofol Notebook Enthusiast

    Reputations:
    37
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    15
    Well, I changed to upload to use CTRL+F6 instead of FN. While I could capture the FN key press on my development laptop, I could not on the M11x. :(

    So back to CTRL, which should work better for R1 users anyway.

    It still irritates me to no end that I can't capture the FN press. :( Oh well.
     
  12. Radam

    Radam Notebook Geek

    Reputations:
    20
    Messages:
    81
    Likes Received:
    0
    Trophy Points:
    15
    Hey Deofol,

    Your program doesn't seem to work for me, it just crashes on launch. Also looking at your code it seems it just turns off the monitor, using WM_SYSCOMMAND, which means that it will turn back on with the mouse moving right? Do you know of any way of keeping the monitor off with mouse/keyboard input?
     
  13. Deofol

    Deofol Notebook Enthusiast

    Reputations:
    37
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    15