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?

DavorinP
  • 237
  • 1
  • 5
  • 14
  • 4
    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? – Hans Passant Feb 20 '13 at 20:18
  • 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. – DavorinP Feb 20 '13 at 21:00
  • possible duplicate of [How do I get the actual Monitor name? as seen in the resolution dialog](http://stackoverflow.com/questions/4958683/how-do-i-get-the-actual-monitor-name-as-seen-in-the-resolution-dialog) – G.Y Jan 31 '15 at 23:45

2 Answers2

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);
}
Soroush Falahati
  • 2,196
  • 1
  • 27
  • 38
  • Yep - after an evening of searching - this brings all the different methods together. Only 64kb to boot. Thanks @Soroush – stigzler Oct 21 '19 at 20:30
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

Community
  • 1
  • 1
Jim
  • 21
  • 2
  • I have already read that post, but couldn't find any function in setup api library which would provide me the data I need. – DavorinP Feb 20 '13 at 21:32