OKEEngine
OKEEngine

Reputation: 908

Changing SECONDARY Monitor screen resolution in c#

I need to change secondary monitor screen resolution dynamically.

I found the following resource which calls Win API. The problem is, it only set the primary monitor. I believe I have to change the dmDeviceName, but I am not sure how to pass it.

http://gallery.technet.microsoft.com/scriptcenter/2a631d72-206d-4036-a3f2-2e150f297515

dm.dmDeviceName //what is the input to this?
dm.dmPelsWidth = width; 
dm.dmPelsHeight = height; 
int iRet = User_32.ChangeDisplaySettings(ref dm, User_32.CDS_TEST); 

Upvotes: 3

Views: 3187

Answers (1)

Glory Raj
Glory Raj

Reputation: 17691

you can try this ...not exactly but will helps you...

use EnumDisplayDevices to figure out what displays you have available and EnumDisplaySettings to get a list of available resolutions for your displays. Use ChangeDisplaySettings to set the resolution you need.

Upvotes: 1

Related Questions