Tuesday, May 15, 2012

Programmatically Moving Displays/Monitors

Matthew van Eerde's web log - Programmatically rearranging displays

Most of my test machines and my laptop have a single display; but I have two dev machines which are each connected to two displays.

When I clean install Windows, I sometimes need to rearrange the displays:

Since I clean install Windows frequently, I wrote myself a little C++ app which does this programmatically using EnumDisplayDevices / EnumDisplaySettings / ChangeDisplaySettingsEx.

Source and binaries attached.

Pseudocode:

image..."

I've been wondering how hard a utility like this would be to write. My monitor setup is different between work and home and often have to tweak/re-arrange the setup. So I've been thinking of maybe writing a utility that detects my location and offers to fix up my monitor placement. Not sure when I'll able to to actually write this, but I wanted to grab this post as it looks like a great starting point (at least to point-out the API's I'm going to have to P/Invoke, etc)

No comments:

Post a Comment

NOTE: Anonymous Commenting has been turned off for a while... The comment spammers are just killing me...

ALL comments are moderated. I will review every comment before it will appear on the blog.

Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...

I reserve, and will use, the right to not approve ANY comment for ANY reason. I will not usually, but if it's off topic, spam (or even close to spam-like), inflammatory, mean, etc, etc, well... then...

Please see my comment policy for more information if you are interested.

Thanks,
Greg

PS. I am proactively moderating comments. Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...