winapi - How to identify inside screen resolution the multiple display that is enabled? -
i've searched on google found no answer, if knows thankful!
i want use command line or winapi check state of multiple display. example : if set : "extended screen" or "duplicate screen" want able verify it. have no idea start.
thanks lot
i start winapi enumdisplaymonitors function: http://msdn.microsoft.com/en-us/library/dd162610%28vs.85%29.aspx
bool enumdisplaymonitors( _in_ hdc hdc, _in_ lpcrect lprcclip, _in_ monitorenumproc lpfnenum, _in_ lparam dwdata );
you need call function setting first 2 parameters null this:
enumdisplaymonitors(null, null, mypaintenumproc, 0); //enumerates display monitors. //the callback function receives null hdc.
now have monitorenumproc callback function: http://msdn.microsoft.com/en-us/library/dd145061%28v=vs.85%29.aspx
bool callback monitorenumproc( _in_ hmonitor hmonitor, _in_ hdc hdcmonitor, _in_ lprect lprcmonitor, _in_ lparam dwdata );
you wiil filled lprcmonitor back:
a pointer rect structure. if hdcmonitor non-null, rectangle intersection of clipping area of device context identified hdcmonitor , display monitor rectangle. rectangle coordinates device-context coordinates.
if hdcmonitor null, rectangle display monitor rectangle. rectangle coordinates virtual-screen coordinates.
based on values monitors can decide whether have extended mode (the rects different) or duplicate (they equal).
hth - luck!
Comments
Post a Comment