Get Exact Monitor/Display/Screen Name
Asked Answered
A

2

1

I have a program where user chooses destination monitor but I just can't get the real monitor name/model.

I have already tried the following:

  • Screen.AllScreens is of no use;
  • WMI and Win32 EnumDisplayDevices both returns Generic PnP Monitor;
  • Device Manager also shows Generic PnP Monitor...

In explorer there are the actual names of monitors attached and in Everest, it shows even more depth in details...

From where these 2 programs gets those information? The last option I ran into is to parse EDID from registry ... has anyone tried this and did it work?

Allergy answered 20/2, 2013 at 20:15 Comment(3)
Before you get carried away with this, how are you going to handle the very common case where the two monitors are exactly the same make and model?Cornall
I'm not worried about that ... I could, I suppose, based on screen bounds determinate the location of screen eg. left, right etc. If there are only two I could just append primary to the main one. But before I get this far, I must first get those information.Allergy
possible duplicate of How do I get the actual Monitor name? as seen in the resolution dialogWedding
G
9

Well, this question is old, however, as for the sake of google redirects, I suggest the 'WindowsDisplayAPI' library.

https://www.nuget.org/packages/WindowsDisplayAPI


Using the library, there are multiple ways to get the display name. The simplest way is:

foreach (var display in Display.GetDisplays())
{
    Console.WriteLine(display.DeviceName);
}

But this is using the old API, if you are sure that your program targets at least Windows Vista, I suggest the following code:

foreach (var target in DisplayConfig.PathDisplayTarget.GetDisplayTargets())
{
    Console.WriteLine(target.FriendlyName);
}
Gaylordgaylussac answered 18/5, 2017 at 11:42 Comment(1)
Yep - after an evening of searching - this brings all the different methods together. Only 64kb to boot. Thanks @SoroushAitken
B
0

Looks like this might have already been answered in a different question: How do i get the actual monitor name as seen in the resolution dialog

Barbette answered 20/2, 2013 at 21:14 Comment(1)
I have already read that post, but couldn't find any function in setup api library which would provide me the data I need.Allergy

© 2022 - 2024 — McMap. All rights reserved.