Share via


GetMonitorInfo

This function retrieves information about a display monitor.

BOOL GetMonitorInfo(
HMONITOR hMonitor, 
LPMONITORINFO lpmi 
);

Parameters

  • hMonitor
    [in] Handle to the display monitor of interest.
  • lpmi
    [out] Pointer to a MONITORINFO structure or MONITORINFOEX structure that receives information about the specified display monitor.

Return Values

TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError.

Remarks

The GetMonitorInfo function can retrieve information about a display monitor in either a MONOITORINFO structure or MONITORINFOEX structure. MONITORINFOEX is a superset of MONITORINFO. MONITORINFOEX has one additional member: a string that contains a name for the display monitor. Most applications do not need to use a display monitor name, and can use fewer bytes by using MONITORINFO.

You must set the cbSize member of either structure to the value that you obtain by calling the sizeof operator for MONITORINFO or MONITORINFOEX before you call GetMonitorInfo. Setting cbSize allows GetMonitorInfo to determine the type of structure you are passing to GetMonitorInfo.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 4.0 and later Winuser.h Windows.h User32.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

MONITORINFO, MONITORINFOEX

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.