16,471
社区成员
发帖
与我相关
我的任务
分享
EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, NULL);
/*
* 获取监视器信息回调
*/
BOOL CALLBACK MonitorEnumProc(
HMONITOR hMonitor, // handle to display monitor
HDC hdcMonitor, // handle to monitor DC
LPRECT lprcMonitor, // monitor intersection rectangle
LPARAM dwData // data
)
{
SDisplayMonitorList *pstruMonitorNode = new SDisplayMonitorList();
pstruMonitorNode->DisplayMonitorInfo.cbSize = sizeof(MONITORINFOEX);
GetMonitorInfo(hMonitor, &(pstruMonitorNode->DisplayMonitorInfo));
//pstruTmpNode->pstruNextMonitor //获取下一个显示器
if (MONITORINFOF_PRIMARY == pstruMonitorNode->DisplayMonitorInfo.dwFlags)//是不是主显示器
{
}
return TRUE;
}