Let me explain my situation. I write a program that should perform certain drawing/rendering actions only when a user sees the screen. In case of a notebook, this means -- only when the lid is open. To determine that I use the PBT_POWERSETTINGCHANGE notification for GUID_LIDSWITCH_STATE_CHANGE, which works great for a single monitor system.
The issue happens when there's one or more externally attached monitors connected to a notebook. In that situation the main notebook screen may remain inactive, while only external monitor(s) are powered on. So in that case the lid would be reported as closed, which should make my program to continue rendering. The problem is how to detect this situation.
I was thinking that I can count monitors using GetSystemMetrics(SM_CMONITORS)
but in this case I don't know where the monitor is "coming from", or in other words, is it a notebook's "native" screen, or an externally plugged in one.
So my question is, can I defferentiate between any external monitors plugged in to the system versus the "native" screen of a notebook?