- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
在编写 WPF 应用程序时,我想获取在标准 Windows 显示设置对话框中找到的显示名称。我试过 WMI 查询 Win32_DesktopMonitor 和 System.Windows.Forms.Screen.AllScreens。
标准窗口显示设置列表中显示的名称是:
Mobile PC Display
DELL 2407WFP
Win32_DesktopMonitor 提供以下内容(已删除无关信息):
DISPLAY 1
Caption = Generic PnP Monitor
CreationClassName = Win32_DesktopMonitor
Description = Generic PnP Monitor
DeviceID = DesktopMonitor1
MonitorManufacturer = (Standard monitor types)
MonitorType = Generic PnP Monitor
Name = Generic PnP Monitor
PNPDeviceID = DISPLAY\DELA017\5&2F0149CC&0&UID1078064
DISPLAY 2
Caption = Generic PnP Monitor
CreationClassName = Win32_DesktopMonitor
Description = Generic PnP Monitor
DeviceID = DesktopMonitor2
MonitorManufacturer = (Standard monitor types)
MonitorType = Generic PnP Monitor
Name = Generic PnP Monitor
PNPDeviceID = DISPLAY\CMO1720\4&164FD10C&0&UID67568640
System.Windows.Forms.Screen.AllScreens 提供了一个设备列表(去除了不相关的信息):
DISPLAY 1
DeviceName = \\.\DISPLAY1
DISPLAY 2
DeviceName = \\.\DISPLAY3
显然,我应该能够将 DeviceName、DeviceID 或 PNPDeviceID 与其他地方的列表进行交叉引用以获取名称,不是吗?
请不要为此打扰我,我用谷歌搜索了我能想到的所有内容,但我找到的只是关于 AllScreens 和 Win32_DesktopMonitor 的信息,但没有找到我们在标准 Windows 显示设置对话框中看到的显示名称。
非常感谢。
最佳答案
看起来有人在 MSDN Forums 上问过这个完全相同的问题.
其中有两个相关的答案,我将在此处复制:
I am not sure exactly what you mean by monitor name, the unique monitor name? If when you call EnumDisplayDevices to enumerate the monitor you can specify the following flag: EDD_GET_DEVICE_INTERFACE_NAME then in the DeviceID field of the DISPLAY_DEVICE structure you will see the unique monitor name.
其次是:
Thanks, your solution was almost 100% there. The only thing I needed to add was a second call to EnumDisplayDevices and passing in the DeviceName returned from the first call. Then the DeviceName is populated with the Monitor's name and not the Video card. Perfect!
我自己没有这样做,所以我无法验证它是否有效,但根据 MSDN 线程的 OP 说它对他有效,这似乎令人鼓舞。
关于c# - 获取与显示设置中找到的匹配的显示名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7486485/
例如,我有一个父类Author: class Author { String name static hasMany = [ fiction: Book,
代码如下: dojo.query(subNav.navClass).forEach(function(node, index, arr){ if(dojo.style(node, 'd
我有一个带有 Id 和姓名的学生表和一个带有 Id 和 friend Id 的 Friends 表。我想加入这两个表并找到学生的 friend 。 例如,Ashley 的 friend 是 Saman
我通过互联网浏览,但仍未找到问题的答案。应该很容易: class Parent { String name Child child } 当我有一个 child 对象时,如何获得它的 paren
我正在尝试创建一个以 Firebase 作为我的后端的社交应用。现在我正面临如何(在哪里?)找到 friend 功能的问题。 我有每个用户的邮件地址。 我可以访问用户的电话也预订。 在传统的后端中,我
我主要想澄清以下几点: 1。有人告诉我,在 iOS 5 及以下版本中,如果您使用 Game Center 设置多人游戏,则“查找 Facebook 好友”(如与好友争夺战)的功能不是内置的,因此您需要
关于redis docker镜像ENTRYPOINT脚本 docker-entrypoint.sh : #!/bin/sh set -e # first arg is `-f` or `--some-
我是一名优秀的程序员,十分优秀!