本文介绍了在 C# 中更改 SECONDARY 监视器屏幕分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要动态更改辅助显示器屏幕分辨率.

I need to change secondary monitor screen resolution dynamically.

我找到了以下调用 Win API 的资源.问题是,它只设置了主监视器.我相信我必须更改 dmDeviceName,但我不确定如何传递它.

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/脚本中心/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...

使用 EnumDisplayDevices 找出什么显示您可用的和 EnumDisplaySettings 以获取您的可用分辨率列表显示.使用 ChangeDisplaySettings 设置您需要的分辨率.

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.

这篇关于在 C# 中更改 SECONDARY 监视器屏幕分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 07:16