Win32 Display Information

Started by
2 comments, last by Anon Mike 16 years, 4 months ago
In Windows, I'm writing an interface to a touchscreen monitor, and I'm looking for someway to map touchscreen sensor positions to window positions without calibrating, if possible. I was wondering how I might go about getting display information from Windows. There will probably be three active monitors, and I will be interested in 2 of them (the touchscreen has 2 monitors under one touch area). I need to determine which displays are the ones I'm interested in, get information about those displays, and determine which portions of the "desktop" are belonging to those displays of interests. Any ideas? The information is clearly there, because the desktop settings dialog uses it. I just don't know how to get to it. Thanks!
Advertisement
I'm sorry, I had forgotten about EnumDisplayDevices... I think I should be good with that.
Okay, once I have used EnumDisplayDevices to get a list of displays, how do I use that information to determine the portion of the "virtual screen" that is provided by a particular display?

And, also, how do I get the usable device name for a monitor? In the NV Control panel it lists one monitor as "WDT EZBlend", but the DISPLAY_DEVICE structure doesn't contain that string anywhere. Where does that come from?
You can get the virtual desktop coordinates via GetSystemMetrics and SM_X/YVIRTUALSCREEN and SM_CX/YVIRTUALSCREEN.

You probably want to use EnumDisplayMonitors/GetMonitorInfo to enumerate. The MONITORINFOEX structure has the area of the virtual desktop occupied by the monitor as well as a string for it. Although I have no idea if that string matches the one you're looking for.
-Mike

This topic is closed to new replies.

Advertisement