GetMonitorRECT

IDesktopWallpaper::GetMonitorRECT method

Retrieves the display rectangle of the specified monitor.

Syntax


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

Parameters

monitorID [in]

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

displayRect [out]

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 codeDescription
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]

Header

Shobjidl.h

IDL

Shobjidl.idl

See also

IDesktopWallpaper

 

 

Show:
© 2016 Microsoft