一个可靠的方法来确定显示设备?方法来、显示设备、可靠

2023-09-05 00:15:51 作者:╰つ゛用笑容改变世界。

我一直在努力寻找解决方案,用于识别显示设备(telivisions在我的情况),以保持主要布局是特别设计为使用多显示器。

I have been working on a solution for identifying display devices (telivisions in my case) to keep the main layout which is especially designed to use multi-monitors.

比方说,我有6个电视连接。 (通常通过HDMI端口,并通过DVI接口等3 3人(通过DVI转HDMI适配器))和它们的物理位置是3x2的是这样的:

Let's say I have 6 televisions connected. (usually 3 of them via HDMI ports and other 3 via DVI port (using DVI-to-HDMI adapter)) and their physical locations are 3x2 like this:

TV1 ... TV2 ... TV3

TV4 ... TV5 ... TV6

我要显示的每个特定的电视上的一些全屏内容。内容1必须到TV1,内容2必须去TV2等... 换句话说:我需要我的内容推到DisplayDevice(电视) - 不向任何地点或屏幕,因为他们可以改变由于Windows行为。 (见下文)

I want to display some full-screen content on each specific television. Content1 must go to TV1, Content2 must go to TV2 etc... In other words: I need to push my content to the DisplayDevice (television) - not to any Location or Screen because they can change due to Windows behavior. (see below)

正如你可能知道,Windows不枚举连接的顺序显示设备(或事实上不基于任何规则可言?)。它使用了总不同的方式来枚举显示器,例如:

As you may know, Windows does not enumerate the display devices in the order you connect them (or in fact not based on any rule at all?). It uses a total different way to enumerate displays, for example:

\。\ DISPLAY3 ... \。\ DISPLAY6 ... \。\ DISPLAY1

\。\ DISPLAY4 ... \。\ DISPLAY2 ... \。\ DISPLAY5

我做的就是在这个,我订购电视显示设置手动,当我连接完所有的人,以配合他们的真实位置。

What I do to get over this, I order the televisions in Display Settings manually when I'm finished connecting all of them to match with their real locations.

但有个问题在这里:一些电视型号仅有pretend就像他们已经被拔掉时,他们关闭(或设置为待机模式),并且会导致Windows 下拉从系统的显示设备和重新枚举显示设备一遍。

But there 's a problem here: Some television models just pretend like they 've been unplugged when they're switched off (or set to stand-by mode) and that causes Windows to drop the display device from the system and re-enumerate the display devices all over again.

由于这种行为(包括一些电视型号和Windows本身)的,我不能指望 Screen.DisplayName 属性甚至 Screen.Location ,因为它们的是变量。他们都重新枚举过程后立即更改。

Because of this behaviour (of both some television models and the Windows itself) I can not count on Screen.DisplayName property or even Screen.Location because they are variables. They both change right after the re-enumeration process.

我已经试图让所有显示设备的序列号,以为我能找到一种方法,与相关的Screen.DisplayName这些数字。好吧,其实我设法用SetupAPI的年代,EnumDisplayDevices在那里,但是这一切到垃圾我已经意识到,大部分的电视机没有一个有效的SerialNumber之后。即使是三星电视不具有的SerialNumber(但三星显示器肯定不会 - 所以我想讲的是一个监控和televisoin之间的区别)

I 've tried to get the serial numbers of all display devices, thinking that I could find a way to correlate those numbers with the Screen.DisplayName. Well, I actually managed the get there by using SetupAPI's, EnumDisplayDevices but this all went to garbage after I've realized that most of the televisions does not have a valid SerialNumber. Even the Samsung TV does not have a SerialNumber (but a Samsung monitor certainly does - so I guess it's about the difference between a "monitor" and "televisoin")

我还在寻找一种方式来克服这个问题。 浮现在我的脑海里其他的想法,也许我应该停止试图推动内容到显示设备(因为他们根本辨认不出来),也许我应该尝试推的内容,以图形卡的端口,这意味着我必须确定哪些端口图形卡关联到显示设备(屏幕),但我都在谈论没有任何关于它的知识 - 甚至不知道如果这样的事情是可以或不可以。

I'm still looking a way to get over this issue. The other idea that comes to my mind is, maybe I should stop trying to push the content to the Display Device (because they are unidentifiable) Maybe I should try to push the content to the graphic card's ports, which means I must determine which ports of graphic cards correlates to which display device (Screen) but I am all talking without any knowledge about it - without even knowing if such a thing is possible or not.

我现在找你的意见,谢谢。

I'm looking for your advices, thanks by now.

推荐答案

当您使用的是DVI,有可能是一个硬件问题的解决方案:EDID管理。这些设备模仿,即使其背后的显示器关闭时有效的EDID。

When you are using DVI, there might be a hardware solution to your problem: EDID Managers. These devices emulate a valid EDID even when the monitor behind it is turned off.