4

When I'm using my laptop, I use 3 displays:

  1. The laptop display
  2. A second monitor (connected through VGA)
  3. A TV (connected through HDMI)

My videocard doesn't support 3 monitors, so I'm constantly switching from 2 to 3: when I'm on the computer, I use the 2nd monitor, and when I want to watch some movies, etc. I use the 3rd.

I currently have to go to Screen Resolution, select the monitor that is not in use, and choose Extend desktop to this display.

Is there a way I can automate it?

Is there any command-line tool, or any Windows API that allows doing it?

Edit:
Display Changer seems to do what I need, but the problem is that it only detects the working monitors. The 3rd monitor (which isn't currently in use) isn't detected, so I can't attach it.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Oscar Mederos
  • 29,016
  • 22
  • 84
  • 124
  • I finally ended up buying a laptop with a Haswell processor. It includes the Intel HD 4600 which supports 3 displays ;) – Oscar Mederos Nov 10 '13 at 17:59

2 Answers2

1

A bit of RE on DisplaySwitch.exe shows that it calls

SetDisplayConfig(0, NULL, NULL, NULL, 0x888)

to set it to Extended on my computer.

From there, a little digging around got me to the SetDisplayConfig documentation obviously and also this SO page with some example code that queries your current display state and adds the actual flags to change them if you want to do so.

Community
  • 1
  • 1
Sleeptime
  • 93
  • 1
  • 9
0

I answered a similar question with suggestion to try UltraMon or use their SDK, but you can also hit the Win32 API directly with ChangeDisplaySettingsEx. Another user, Sai, gave an reference to an example showing use of the function.

Community
  • 1
  • 1
Mitch
  • 21,223
  • 6
  • 63
  • 86
  • Thanks for your reply. Let me take a look at those links :) – Oscar Mederos Feb 22 '13 at 19:30
  • UltraMoon profiles work for me. The only downside is that all the opened windows I had are placed into the 1st monitor once I switch from profiles. – Oscar Mederos Feb 22 '13 at 20:11
  • @OscarMederos, I have noticed that issue with RDP as well. I am not sure if it is an UltraMon issue or a more widespread one. – Mitch Feb 22 '13 at 20:13
  • I'll wait to see if someone posts another answer. If not, I'll just accept this one, since I'm looking for a more scripting solution :) – Oscar Mederos Feb 22 '13 at 20:15