简体   繁体   中英

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); 

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM