3

For my project I need a way to get data regarding screens that are connected. In specific, I need to identify whether a monitor is a laptop internal screen or an external screen, and get all the screen data.

I need to get this information both in c++ and C#.

I read about Win32_DesktopMonitor, about EnumDisplayDevices and about Screen Class. I read also some related questions here: Monitor ID and Serial Number Find Number and resolution to all monitors EnumDisplayDevices vs WMI Win32_DesktopMonitor, how to detect active monitors?

I havn't found an answer yet. Any Ideas?

Community
  • 1
  • 1
eskadi
  • 225
  • 2
  • 17
  • 1
    @GrantWinney if you look into the links he provided, those links will give you an enormus amount of information about the screen, but not whether it is an internal or external screen, so he did research, but could not find an answer. – SynerCoder May 20 '14 at 13:30
  • 2
    Windows operating system doesn't care if a monitor is internal verses external. If your application needs to display something on an external monitor, the program should give the user a choice and ask them which monitor is external. – Black Frog May 20 '14 at 13:32
  • Looking over the links in your question I came across [Screen.PrimaryScreen Property](http://msdn.microsoft.com/en-us/library/system.windows.forms.screen.primaryscreen.aspx). I believe that should lead you in the right direction. I has an example of making a Windows Forms fill the primary screen. Then everything else should be on the other monitor. – Black Frog May 20 '14 at 13:39
  • Thanks for your comments. The thing is, going over all the screens gives me information, but I could't find from that information whether the monitor is internal or external and this is the information I am looking for. – eskadi May 21 '14 at 13:09

1 Answers1

-2

What you can do is query the Windows WMI classes:

http://msdn.microsoft.com/en-us/library/aa394554(v=vs.85).aspx

Those classes allows the user to collect various information about the computer (hardware, os, ...)

I don't know if you'll find the properties you need, but it might be worth a look. You're looking for this class:

http://msdn.microsoft.com/en-us/library/aa394122(v=vs.85).aspx

Complexity
  • 5,466
  • 5
  • 35
  • 82