I am trying to draw on any monitor not the main monitor. I use the DISPLAY_DEVICE pointer and run through all 10 ports. I check
if (EnumDisplayDevices(0, [0-9],&DISPLAY_DEVICE,0)!=NULL)
If this is true, that means I found a connected display. I than check the StateFlags for main monitor by checking the third bit set.
If(!(DISPLAY_DEVICE.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE))
If it's not set and a display, it's not the main monitor.
If it is set and a display, it is the main monitor.
I am running into the opposite in one scenario. The main display is identity number as 2, and it does not have the third bit set. So it's drawing on the main monitor when I am looking for ANYTHING but the main monitor. I know usually identity numbers are meaningless, however out of 70 machines only one acts this way. Am I understanding this wrong or does windows have a bug here the main monitor is set to identity 2 and does not set the 3rd bit in the state flags?