I'd like to list down the width and height to a connected monitors.
But I don't have a good idea to get a HMONITOR in a enumerative way...
Here is my code...
[ code ]
// The number of monitors connected to system
const int nMonitor = ::GetSystemMetrics(SM_CMONITORS);
for(int iMonitor=0 ; iMonitor<nMonitor ; iMonitor++)
HMONITOR hMonitor = ???; // This is my question actually. How should
I do to get a HMONITOR from index 'iMonitor' ?
MtrInfo.cbSize = sizeof(MONITORINFO);
::GetMonitorInfo(hMonitor , &MtrInfo);
// Do something with 'MtrInfo'
[ /code ]
For I had surveyed.....
MonitorFromPoint(), MonitorFromRect() and MonitorFromWindow() is not
what I exactly want...