views:

771

answers:

5

I use a laptop as my primary workstation. Sometimes I work alone on it, but a significant portion of the time, I'm at my office desk and I hook up an external monitor to increase my workspace.

Every time I perform this action, I click the same dialog boxes in Windows Vista to setup the dual screen and position the window. It seems like a repeatable task that I could automate.

I'd like to be able to plug in my monitor cable, double click a program and have it automatically configure the monitor.

What type of program could do this? I haven't found much online that relates. I'm thinking of trying an autohotkey script, or the Windows Accessibility API with PowerShell. Has this problem already been solved?

Clarification: I'm specifically looking to automate the steps I use with my mouse that invoke the base functionality in Windows Vista.

  1. Right click on desktop
  2. Select Personalize in context menu
  3. Click display settings
  4. Click monitor #2, then click checkbox to "Extend desktop to this monitor"
  5. Click and drag monitor #2 to the left of monitor #1
  6. Click OK to close the dialog
  7. Click Yes in the subsequent pop up to accept these monitor settings

Update: Windows 7 does this automatically

I just upgraded to Windows 7 and it remembered my dual monitor settings. I set them once at work as listed above, then unplugged and worked at home over the weekend. I came in on Monday morning, booted up, plugged in and whammo! It just worked. Thanks Windows 7!

A: 

Try UltraMon for excellent dual monitor support. I've been using it for years on a number of different laptops and desktops and it works great. I've only used XP so I am not sure how it works with Vista.

slolife
I've used UltraMon a while back. My goal is to automate the screen configuration, I'm not aware of a way to just run a program and have UltraMon automatically setup my monitors to a predetermined configuration. There's some clicking involved, right?
AndrewDotHay
Good point. Clicking around in ultramon, I don't see settings for configuring displays that way. It does more in terms of window customization.
slolife
A: 

My Leovo T60p does this automatically without any special steps. Try upgrading your video drivers, and check the manufacturer's site for any utilities that can do that.

cdonner
A: 

If you have windows vista or 7 you could hit the windows_key + P. You have a bunch of options to select including extend

That might flip on a connected monitor, right? I'm not sure that's going to help with #5 in my list though: dragging the extra monitor to the left side of my laptop monitor.
AndrewDotHay
A: 

I believe Ultramon would in fact work. In the right-click menu on the Ultramon icon in the systray there is a "disable/enable secondary" command.

I think you could simply:

  1. plug in the second monitor
  2. select "enable secondary"
dangph
+1  A: 

I haven't seen an existing utility that does this but it would be pretty easy to write one using the Win32 APIs. Via this page, EnumDisplayDevices gets a list of display devices, EnumDisplaySettingsEx gets the current settings and ChangeDisplaySettingsEx will make the changes.

The DEVMODE.dmPosition field should contain the virtual coordinates of the top left corner of the display, with the primary monitor always being (0,0) and the others relative to that.

The tool would need two modes, the first saves the current settings to a config file, and the second applies the settings from the config. I'd store/retrieve only the display device index, name, and each of the DEVMODE.dm* fields mentioned in the ChangeDisplaySettingsEx docs. A text-based config allows for hand-edits.

devstuff