Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect if monitor is a projector?

Is there a way to use the Windows APIs to detect if a particular monitor is a projector (beamer) rather than a screen?

(I'm writing a projection mapping desktop application, and I'd like it to automatically detect if a projector is attached and active to allow the user to compare the reality to the preview.)

I've used both EnumDisplayMonitors and EnumDisplayDevices to find the monitors, but I can't find any flag or other indication of the type of the display. I've looked in the DEVMODE and the DISPLAY_DEVICE and the registry keys the latter points to. I don't see a DeviceCapabilities or GetDeviceCaps call that can distinguish between a screen and a projector. I also looked in the device manager to see if there was a property that distinguishes my regular monitor from the projector, but I couldn't find anything. So maybe there's no way to do it.

But, the Screen Resolution control panel applet identifies the projector as "PROJECTOR" while identifying my primary monitor as "Dell U3011." Using EnumDisplayDevices, I can get the "Dell U3011" string from the DISPLAY_DEVICE, but, for the projector, I get just "Generic PnP Monitor." Somehow, the applet must be looking somewhere else to get that "PROJECTOR" string or it shows "PROJECTOR" for any Generic PnP Monitor that seems to be a projector. So where does it look and how does it know?

like image 883
Adrian McCarthy Avatar asked Apr 01 '18 21:04

Adrian McCarthy


People also ask

What is the difference between projector and monitor?

Answer: Monitor is the display screen, projector is a device that projects the display on an external screen.


1 Answers

I believe the answer is that there is no reliable way to do it.

The "PROJECTOR" string that the control panel showed was arbitrary text that the system pulled from the EDID information. As far as I can tell, Windows doesn't actually "know" whether a monitor is a projector or an LCD panel or a CRT tube.

The EDID information doesn't seem to have a flag to indicate whether this is a projector. I saw a note that projectors will typically set one or both of the physical image dimensions (the ones measured in centimeters) to zero. But that was in a description of EDID 1.4, and most of my devices use EDID 1.3. Indeed, none of the projectors that I tried have a 0 for any physical dimension, so it's not a reliable signal.

like image 116
Adrian McCarthy Avatar answered Sep 30 '22 03:09

Adrian McCarthy