Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Registry setting for "Extending desktop onto 2nd monitor" 2

Status
Not open for further replies.

sfatz

Technical User
Nov 16, 2004
46
US
I use a laptop, that when in the docking station, is hooked to a second monitor (I have to work with CAD drawings as part of the job). I occasionally undock the laptop for meetings around the office (we're wireless). When I re-dock, I have to re-extend the desktop to the second monitor. To do this I have to bring up the "Display Properties" dialog box, click on the Settings tab, click on the monitor icon, click on the "Extend my Windows Destop onto this Monitor" checkbox, and then save and close the dialog.

This setting must be saved in the registry somewhere. I want to create a VB-applet that will toggle this setting for me automatically.

Can anyone tell me where to find this registry setting? Also, do you know of any issues with changing this setting with a VB app?

Thank you in advance for the help and advice.
 
Here are the registry settings that get modified:

[HKEY_CURRENT_CONFIG\System\CurrentControlSet\CONTROL\VIDEO\< Second Adapter ID Here>\0000]
"Attach.ToDesktop"=dword:00000001
"DefaultSettings.BitsPerPel"=dword:00000020
"DefaultSettings.XResolution"=dword:00000320
"DefaultSettings.YResolution"=dword:00000258
"DefaultSettings.VRefresh"=dword:0000003c
"DefaultSettings.Flags"=dword:00000000
"DefaultSettings.XPanning"=dword:00000000
"DefaultSettings.YPanning"=dword:00000000
"DefaultSettings.Orientation"=dword:00000000
"DefaultSettings.FixedOutput"=dword:00000000
"Attach.RelativeX"=dword:00000000
"Attach.RelativeY"=dword:00000000

Unfortunately, <Second Adapter ID Here> changes on a PnP system. You may need to delv into a little code.

API: ChangeDisplaySettingsEx

The API:
Try something like this: [/url]Or%20grab%20the%20code%20from%20this%20KB:http://support.microsoft.com/default.aspx?scid=kb;en-us;308216
 
Thanks for the responses. Between them, I should be able to create what I'm looking for.
Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top