prevent monitor switching when closing laptop lid

EDIT: I know this is an old question, but I thought it deserved a proper answer.

There is a way to solve this problem (at least with Windows 7). Bear in mind that this comes with a cost; here are the caveats

  1. Closing your laptop lid will not dim or turn off the screen.
  2. You have to change a device driver, which may be a bit scary for some people

Despite the above cons, I think the benefits outweighs it by a lot. There are ways to combat the first caveat too:

  • Set your monitor to dim in one minute and for it to turn off in 2 minutes within Power Options. That way, the monitor will not be unnecessarily on when you're not using the computer for more than 2 minutes. (this won't help if you're still using the other monitor)
  • Also, take a look at this link to create a shortcut to turn off your monitor.

I'm using a MacBook with Bootcamp; luckily, I can just turn down my brightness all the way so that it dims the screen completely. Some other laptop models may be able to do that as well.

Here are the steps:

  1. Open Device Manager (search it in the Start menu).
  2. In "System devices" find "ACPI lid".
  3. Open "ACPI lid" properties, and go to the "Driver" tab.
  4. Select "Update driver".
  5. Choose "Browse my computer for driver software" and "Let me pick.."
  6. Uncheck "Show compatible hardware".
  7. In "Manufacturer" select "(Standard system devices)", or in Windows 8, choose Microsoft as the manufacturer - different place, but the hack still works (at least in the 64bit Release Preview)
  8. For model, select "Volume manager".
  9. Restart the system and it works!

Source: http://forums.whirlpool.net.au/archive/1421975 - yakup's post


The solution by Brett via Powershell (if you're too lazy)

To execute it:

  1. save script in some folder (LidAlwaysOpen.ps1)
  2. run cmd.exe as administrator
  3. type powershell
  4. type Set-ExecutionPolicy RemoteSigned (this will allow execution of Powershell stuff on your machine only)
  5. cd to folder you've saved script
  6. type ./LidAlwaysOpen.ps1

Script code:

foreach ($display in Get-ChildItem -Path Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video) {
 New-ItemProperty -LiteralPath Registry::$display\0000 -Name LidAlwaysOpen -PropertyType DWORD -Value 1
}

For Windows 7:

  1. Open the registry editor (regedit.exe)
  2. Navigate to the following key (you will have to identify the correct GUID for your display):

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\{********-****-****-****-************}\0000
    
  3. Create a new DWORD called LidAlwaysOpen and set its value to 1
  4. Reboot