CMonitor CMonitors::GetPrimaryMonitor() { HMONITOR hMonitor = ::MonitorFromPoint( CPoint( 0,0 ), MONITOR_DEFAULTTOPRIMARY ); ASSERT( IsMonitor( hMonitor ) ); CMonitor monitor; monitor.Attach( hMonitor ); ASSERT( monitor.IsPrimaryMonitor() ); return monitor; }
// // returns the primary monitor CMonitor CMonitors::GetPrimaryMonitor() { //the primary monitor always has its origin at 0,0 HMONITOR hMonitor = ::MonitorFromPoint( CPoint( 0,0 ), MONITOR_DEFAULTTOPRIMARY ); ASSERT( IsMonitor( hMonitor ) ); CMonitor monitor; monitor.Attach( hMonitor ); ASSERT( monitor.IsPrimaryMonitor() ); return monitor; }