Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function retrieves information about a screen.

Syntax

BOOL GetMonitorInfo(
  HMONITOR 
hMonitor, 
  LPMONITORINFO 
lpmi 
);

Parameters

hMonitor

[in] Handle to the screen of interest.

lpmi

[out] Pointer to a MONITORINFOor MONITORINFOEXstructure that receives information about the specified screen.

Return Value

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

Remarks

This function can retrieve information about a screen in either a MONITORINFOor MONITORINFOEXstructure. MONITORINFOEX, a superset of MONITORINFO, has one additional member: a string that contains a name for the screen. Most applications do not need to use a screen name and can use fewer bytes by using MONITORINFO.

You must set the cbSizemember of either structure to the value that you obtain by calling the sizeofoperator for MONITORINFOor MONITORINFOEXbefore you call GetMonitorInfo. Setting cbSizeallows GetMonitorInfoto determine the type of structure you are passing to it.

Requirements

Header windows.h
Library coredll.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also