简体   繁体   English

如何使用WinAPI / C#获取监视器/显示设备名称

[英]how to get monitor/display device names using WinAPI/C#

I am working an application in C#/WPF and wanted to get the list of all attached display monitors. 我正在使用C#/ WPF中的应用程序,并希望获得所有连接的显示器监视器的列表。 I used the Screen class and successfully got the list but now the list is having each monitor name as ".\\Display1\\XXXXXXXX" etc . 我使用了Screen类并成功获得了列表,但现在列表中的每个显示器名称都是“。\\ Display1 \\ XXXXXXXX”等。 which is not readable. 这是不可读的。 However, My Nividia control panel list them as proper names. 但是,My Nividia控制面板将它们列为专有名称。 So can any one tell me how to get those names or some api reference. 所以任何人都可以告诉我如何获得这些名称或api参考。

Note := I already tried EnumDisplayDevices which is returning the names but they are different what it should be ? 注意:=我已经尝试过返回名称的EnumDisplayDevices,但它们应该是什么? so its confusing the matters more ? 这让事情更加混乱?

I tried WMI and it allowed me to access more information, however, the names are still "Default Monitor 1" "Default Monitor 2" while there is no information about manufacturer and now i am thinking does it available to us at all by using normal api's 我尝试了WMI,它允许我访问更多信息,但是,名称仍然是“默认监视器1”“默认监视器2”,而没有关于制造商的信息,现在我想我们可以通过使用正常蜜蜂

Query for Win32_DesktopMonitor in WMI. 在WMI中查询Win32_DesktopMonitor。 Msdn MSDN

Check out WMI (Windows Management Instrumentation). 查看WMI(Windows Management Instrumentation)。 It's not an easy library but it can tell you a ton of stuff about your system. 它不是一个简单的库,但它可以告诉你很多关于你的系统的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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