Skip to content

Latest commit

 

History

History
60 lines (39 loc) · 1.7 KB

File metadata and controls

60 lines (39 loc) · 1.7 KB

Home

Function name : GetMonitorInfo

Group: Multiple Display Monitors - Library: user32


The GetMonitorInfo function retrieves information about a display monitor.


Code examples:

How to change display settings: screen resolution, screen refresh rate
How to detect if additional monitor is connected and active

Declaration:

BOOL GetMonitorInfo(
  HMONITOR hMonitor,  // handle to display monitor
  LPMONITORINFO lpmi  // display monitor information
);  

FoxPro declaration:

DECLARE INTEGER GetMonitorInfo IN user32;
	INTEGER  hMonitor,;
	STRING @ lpmi
  

Parameters:

hMonitor [in] Handle to the display monitor of interest.

lpmi [out] Pointer to a MONITORINFO or MONITORINFOEX structure that receives information about the specified display monitor.


Return value:

If the function succeeds, the return value is nonzero.


Comments:

Returned structure type, MONITORINFO or MONITORINFOEX, is defined by cbSize member set before calling this function. The MONITORINFOEX structure is a superset of the MONITORINFO structure.

hMonitor value can be obtained from a call to either of EnumDisplayMonitors, MonitorFromWindow, MonitorFromPoint, MonitorFromRect.

The EnumDisplayMonitors is unlikely to be used in pure FoxPro code since it requires a callback function.

See also EnumDisplayDevices, EnumDisplaySettings functions.