如何使用WinAPI的/ C#来获得监视器/显示设备名称 [英] how to get monitor/display device names using WinAPI/C#

查看:246
本文介绍了如何使用WinAPI的/ C#来获得监视器/显示设备名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作在C#/ WPF应用程序,并希望得到所有连接的显示监视器列表。我使用的屏幕类,并顺利拿到了名单,但现在列表中有每个监视器名为.\Display1\XXXXXXXX等。这是不可读的。然而,我的NIVIDIA控制面板列出他们的专有名词。所以任何一个可以告诉我怎么去这些名称或某些API参考

I am working an application in C#/WPF and wanted to get the list of all attached display monitors. I used the Screen class and successfully got the list but now the list is having each monitor name as ".\Display1\XXXXXXXX" etc . which is not readable. However, My Nividia control panel list them as proper names. So can any one tell me how to get those names or some api reference.

请注意:=我已经尝试过它返回名称EnumDisplayDevices但它们是不同的必要内容是什么?所以其混淆的问题吗?

Note := I already tried EnumDisplayDevices which is returning the names but they are different what it should be ? so its confusing the matters more ?

我试过WMI和它让我获得更多信息,但名字还是默认监视器1,默认显示器2虽然没有关于生产厂家的信息,现在我想确实提供给我们在所有使用正常的API

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

推荐答案

查询Win32_DesktopMonitor在WMI。
MSDN

Query for Win32_DesktopMonitor in WMI. Msdn

这篇关于如何使用WinAPI的/ C#来获得监视器/显示设备名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆