如何以编程方式更改扩展监视器和双监视器的设置? [英] How to chanege settings for extended monitor and dual monitor programmatically?
本文介绍了如何以编程方式更改扩展监视器和双监视器的设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个Radeon显卡,带有2个图形端口,一个用于VGA,另一个用于DVI端口.这2个端口上连接了2个监视器.我想创建一个显示2个选项的应用程序. 1>扩展,和2>双屏并执行以下操作.
情况1 :(扩展)第一个监视器将充当主监视器,第二个监视器将充当扩展监视器
情况2 :(双屏)第一台和第二台显示器将作为双屏工作(两台显示器上的显示相同)
请帮助我.
I have a Radeon Graphics card with 2 Graphics port one for VGA and other for DVI port. 2 monitor is connected on these 2 ports. I want to create an application that will show 2 options. 1> Extended, and 2> Dual screen and perform the followings.
Case1: (Extended) 1st monitor will work as primary monitor and 2nd monitor will work as extended monitor
Case2: (Dual Screen) 1st and 2nd monitors will work as a dual screen (Same display on both monitor)
Please help me.
推荐答案
可以使用P/调用USER32.dll的设备上下文参考来执行此操作.看一下ChangeDisplayFunction和EnumDisplaySettings,在这里进行描述:
http://msdn.microsoft.com/en-us/library/dd183411.aspx [
http://www.pinvoke.net/default.aspx/user32/ChangeDisplaySettings.html
http://www.pinvoke.net/default.aspx/user32/EnumDisplayDevices.html
如果您是nvidia显卡的所有者,请查看
nvidia api,您需要P/调用NVCPL.DLL:
http://developer.download.nvidia.com/SDK/9.5/Samples/DEMOS/common/src/NvCpl/docs/NVControlPanel_API.pdf [
Hi,
it''s possible to do this with the Device Context Reference which P/Invokes to USER32.dll . Have a look into ChangeDisplayFunction and EnumDisplaySettings, described here:
http://msdn.microsoft.com/en-us/library/dd183411.aspx[
http://www.pinvoke.net/default.aspx/user32/ChangeDisplaySettings.html
http://www.pinvoke.net/default.aspx/user32/EnumDisplayDevices.html
if you are an owner of nvidia graphics card, have a look into
nvidia api, you will need to P/Invoke NVCPL.DLL:
http://developer.download.nvidia.com/SDK/9.5/Samples/DEMOS/common/src/NvCpl/docs/NVControlPanel_API.pdf[^]
Best Regards
这篇关于如何以编程方式更改扩展监视器和双监视器的设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文