我的程序需要作多显示屏的扩展显示,所以需要找到除了主屏幕外的其他副屏幕的分辨率。请问各位高手该如何如何通过函数获得其他副屏幕的分辨率呢?

解决方案 »

  1.   

    EnumDisplayEx枚举,然后GetDisplaySettings
      

  2.   

    DEVMODE Mode;
    EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &Mode);
    Mode.dmPelsWidth =  显示器的宽度
    Mode.dmPelsHeight = 显示器的高度
    Mode.dmDisplayFrequency = 显示器的刷新频率
      

  3.   

    EnumDisplayMonitors
    The EnumDisplayMonitors function enumerates display monitors (including invisible pseudo-monitors associated with the mirroring drivers) that intersect a region formed by the intersection of a specified clipping rectangle and the visible region of a device context. EnumDisplayMonitors calls an application-defined MonitorEnumProc callback function once for each monitor that is enumerated. Note that GetSystemMetrics(SM_CMONITORS) counts only the display monitors.BOOL EnumDisplayMonitors(
      HDC hdc,                   // handle to display DC 
      LPCRECT lprcClip,          // clipping rectangle 
      MONITORENUMPROC lpfnEnum,  // callback function
      LPARAM dwData              // data for callback function 
    );