I want to build a tiny application in Windows Vista. It should tell me, whether it (the application window itself) is displayed on the screen of a laptop or on an external screen. I'd like to use C++ in VisualStudio 08.
I seriously don't have a clue about programming for Windows, don't even know which way to approach this problem or which libraries to use. I would totally appreciate if someone of you guys/girls could help me out with a quick hint.
The Multiple Displays Monitor Functions was exactly what I was looking for, I hope..at least, it feels good. When I understood Vladimir right, you can't yet tell which monitor is external, since one could use the external monitor as primary display.
On the other hand, with making a WQL Query on the WmiMonitorConnectionParams (by stupidly altering about two lines of the example code as seen on http://msdn.microsoft.com/en-us/libr...=VS.85%29.aspx ), I can distinguish between an internal and an external display.
Well, now I'm not yet quite sure if I can map these both informations...or if i don't see the simple solution..
GetMonitorInfo gives me \\.\DISPLAY1
WMIMonitorID querying gives me sth. like DISPLAY\LGD0032\7&14066721&0&UID50331920_0
MonitorConnectionParams querying gives me 2147483648 for internal and sth. else for all external screens
that's pretty much it...i must have missed something, because this looks not too good for mapping, no clue how to proceed from there
actually i have all the information i need, just the link is missing
* a window is positioned on \\.\DISPLAY1 or \\.\DISPLAY2 and this monitor is primary or not
* MISSING: \\.\DISPLAY1 == \DISPLAY\LGD0032\7&14066721&0&UID50331920_1 or
* \DISPLAY\..... is internal or external
and this is the problem...or..the challenge
* WMIMonitorConnectionParams and WMIMonitorID classes give me an InstanceName "\DISPLAY\LGD0032\..." etc.
* EnumDisplayDevices and Victors GetMonitorInfo functions give me a DeviceName "\\.\DISPLAY1" etc.