-
问题内容:怎样判断显卡有几个输出口?
- 原讨论链接:http://community.csdn.net/expert/topicview1.asp?id=5119432
- 所属论坛:C#
审核组:.NET技术
- 提问者:Floating
解决者:hdt
- 感谢:hdt
- 关键字:.NET技术 C# 显示器 请问 显卡 输出 获取 有的 判断 哪儿 枚举 接入
- 答案:
有的显卡支持接2个显示器,有的支持4个?
请问这个在哪儿可以获取?
---------------------------------------------------------------
EnumMonitors api
可以枚举系统具体接入几个显示器。
try
[DllImport("winspool.drv", CharSet = CharSet.Auto, SetLastError = true)]
private static extern bool EnumMonitors(string pName, uint Level,
System.IntPtr pMonitors,uint cbBuf,
[Out] out uint cbNeeded,
[Out] out uint cbReturned);
byte[] buff = new byte[4096];
System.IntPtr pbuff = System.Runtime.InteropServices.Marshal.UnsafeAddrOfPinnedArrayElement( buff , 0 );
uint b, n, r;
b = 4098;
n = 0;
r = 0;
bool bret = EnumMonitors(null, 1, pbuff, b, out n, out r);
- 评价:
给朵鲜花(48)
扔个鸡蛋(32)