一、取得显示器的个数
GetSystemMetrics(SM_CMONITORS);
二、根据窗口句柄、矩形区域、点取得显示器的句柄
MonitorFromRect( lprc, MONITOR_DEFAULTTONULL )
MonitorFromPoint( pt, MONITOR_DEFAULTTONULL )
MonitorFromWindow( pWnd->GetSafeHwnd(), MONITOR_DEFAULTTONULL )
三、取得主显示器的句柄
//the primary monitor always has its origin at 0,0
HMONITOR hMonitor = ::MonitorFromPoint( CPoint( 0,0 ), MONITOR_DEFAULTTOPRIMARY );
四、根据显示器的句柄返回显示区域
MONITORINFO mi;
RECT rc;
mi.cbSize = sizeof( mi );
::GetMonitorInfo( m_hMonitor, &mi );
rc = mi.rcMonitor;
参考代码:点击我