I'm trying to obtain screenshots of multiple monitors using IDirect3DDevice9::GetFrontBufferData()
and it works but I cannot figure out how I could identify which IDirect3DDevice9
corresponds to which monitor and so how its output is positioned on Windows "virtual screen".
I tried IDirect3DDevice9::GetViewport()
but it always obtains viewport coordinates which have left top coordinate set to "0,0" (and proper width and height) so it cannot be used to identify which monitor is left and which is right.
So far I found that when I call EnumDisplayMonitors()
then monitors are enumerated in the order as devices are enumerated when I call IDirect3D9::GetAdapterDisplayMode()
and this can be used. However I see not documentation saying whether any order of enumeration is guaranteed for these two functions.
Can I rely on EnumDisplayMonitors()
and IDirect3D9::GetAdapterDisplayMode()
having the same enumeration order? Is there any better way?