Question Changing the default display

mrselfdestruct

New member
Joined
Jun 17, 2008
Messages
2
Programming Experience
1-3
Hi there, I have done a lot of googleing on this and can't find a definitive answer.

I have a dual head graphics card with 2 monitors attatched.

I need a bit of code to swap the primary display.

I have an idea that it's something to do with APIs (ChangeDisplaySettings or ChangeDisplaySettingsEx) but I have no idea how to implement these.

If anyone is feeling kind, it'd be great if someone could drop in some sample code.

I am a beginner/intermediate when it comes to VB. I can usually work out the solution but this one has perplexed me.

Thanks in advance.

Rich.
 

cjard

Well-known member
Joined
Apr 25, 2006
Messages
7,052
Programming Experience
10+
The notion of primary-display ness is set by your graphis card drivers, not windows. Windows just draws onto what it thinkis are pimary and secondary. You must use the GFX card drivers to choose which. Ask the manufacturer of your graphics card (not us, sorry)
 

MattP

Well-known member
Joined
Feb 29, 2008
Messages
1,206
Location
WY, USA
Programming Experience
5-10
The notion of primary-display ness is set by your graphis card drivers, not windows. Windows just draws onto what it thinkis are pimary and secondary. You must use the GFX card drivers to choose which. Ask the manufacturer of your graphics card (not us, sorry)

Not to mention users HATE it when you do this stuff (yeah I'm talking about you Vista TMM!)
 

mrselfdestruct

New member
Joined
Jun 17, 2008
Messages
2
Programming Experience
1-3
Well I've managed to get it to work using my nvidia drivers, which is great.

If anyone's interested, I used:

Call Shell("rundll32.exe NvCpl.dll,dtcfg primary 2") 'Replace the 2 with a 1 to switch back.

Just in case anyone does know how to do this via windows APIs, I would be interested as I'd like to have my code work on other computers.

Cheers.
 
Top Bottom