Display Settings - Dual Monitor API

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Experts -

I have a laptop running XP docked to a dual monitor
setup. I find it quite annoying that even when I undock,
I am still on dual monitor setting, which means some of
my apps are on the hidden screen and thus unusable.

I have to mannually go to the 'display settings' and
change it to single monitor mode by not 'extending the
desktop' to my 2nd monitor.

I am figuring that there has to be an easy way to make
the configuration occure automitically, OR that there is
a Windows API that I can use to change the settings
programatically by embedding it in some script that I run
off a button or something.....

Can anyone help me? I've tried finding resources on this
and have come up with absolutley nothing.

thanks,
Mark
 
Well, you "could" write something like this, I don't know what exists for it
already. But watch the message loop (I don't know what message to watch
for) for an undocked message. I think you can play with your display
settings from some namespaces in .NET, I dunno.

but even if you can't, upon parsing that message, just get a list of all
your open windowd applications, grab the handles and set all there Top and
Left properties to 0,0

Kinda ghetto, but it would work...

You could even persist the viewstate of those windows from docking to
undocking in a simple property bag. That way, when docked again, you could
move them all back to there original position.

I may get bored and try this later...
 
Mark,

My experience with this issue is that it is driver dependant. Some
drivers detect the change and handle it gracefully, and some don't. I
wish I had an answer for this but I have found it to be directly
related to your video card and driver. Hopefully CJ's suggestion is
helpful.
 
Back
Top