Automate dual monitor setup in Vista

I use a laptop as the main workstation. Sometimes I work alone on this, but most of the time I am on my desktop and I connect an external monitor to increase the workspace.

Each time I perform this action, I click the same dialog boxes in Windows Vista to set up the dual screen and position the window. This is like a repeatable task that I could automate.

I would like to be able to connect the monitor cable, double-click on the program and automatically configure the monitor.

What type of program could do this? I have not found much online as far as. I'm thinking of trying an autohotkey script or an Accessibility API with PowerShell. Has this problem been resolved yet?

Clarification: I specifically plan to automate the steps that I use with the mouse, which invoke the basic functions in Windows Vista.

  • Right click on the desktop
  • Select Personalization from the context menu.
  • Click Display Settings
  • Click monitor number 2, then check the box "Extend the desktop on this monitor."
  • Click and drag monitor # 2 to the left of monitor # 1
  • Click OK to close the dialog box.
  • Click “Yes” in the following pop-up menu to accept these monitor settings.

Update: Windows 7 does it automatically

Windows 7, . , , . , , ! . Windows 7!

+5
6

, , ! !!!

http://www.autohotkey.com

script Windows + 1 Windows + 2. AutoHotKey , .

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Recommended for catching common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#1::
Send {LWin}
WinWaitActive Start menu
Send Adjust Screen Resolution
Send {enter}
WinWaitActive Screen Resolution
ControlClick ComboBox3
Send {PgDn}
Send {Up} ; Select "Show desktop only on 1"
Send {enter}
Sleep 3000 ; workaround - cannot select accept/revert window?
Send {left}
Send {enter} ; accept changes
Return
#2::
Send {LWin}
WinWaitActive Start menu
Send Adjust Screen Resolution
Send {enter}
WinWaitActive Screen Resolution
ControlClick ComboBox3
Send {PgDn}
Send {Up}
Send {Up} ; Select "Extend these displays"
Send {enter}
Sleep 3000 ; workaround - cannot select accept/revert window?
Send {left}
Send {enter} ; accept changes
Return
0

, , , API Win32. Via , EnumDisplayDevices EnumDisplaySettingsEx ChangeDisplaySettingsEx .

DEVMODE.dmPosition , (0,0) .

, , . / , DEVMODE.dm *, ChangeDisplaySettingsEx. .

+1

UltraMon . , . XP, , Vista.

0

My Leovo T60p - . , .

0

Vista vista 7, windows_key + P. ,

0
source

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

I think you could just:

  • connect a second monitor
  • select "enable secondary"
0
source

All Articles