IDesktopWallpaper::GetMonitorRECT method (shobjidl_core.h)

Retrieves the display rectangle of the specified monitor.

Syntax

HRESULT GetMonitorRECT(
  [in]  LPCWSTR monitorID,
  [out] RECT    *displayRect
);

Parameters

[in] monitorID

The ID of the monitor to query. You can get this value through GetMonitorDevicePathAt.

[out] displayRect

A pointer to a RECT structure that, when this method returns successfully, receives the display rectangle of the monitor specified by monitorID, in screen coordinates.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code, including the following.

Return code Description
S_FALSE
The monitor specified by monitorID is not currently attached to the system.
E_POINTER
A NULL pointer was provided in displayRect.
E_INVALIDARG
The ID supplied in monitorID cannot be found.

Requirements

   
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)

See also

IDesktopWallpaper