GetThemeBackgroundRegion function (uxtheme.h)

Computes the region for a regular or partially transparent background that is bounded by a specified rectangle.

Syntax

HRESULT GetThemeBackgroundRegion(
  [in]  HTHEME  hTheme,
  [in]  HDC     hdc,
  [in]  int     iPartId,
  [in]  int     iStateId,
  [in]  LPCRECT pRect,
  [out] HRGN    *pRegion
);

Parameters

[in] hTheme

Type: HTHEME

Handle to a window's specified theme data. Use OpenThemeData to create an HTHEME.

[in] hdc

Type: HDC

HDC to draw into. The DC uses dots per inch (DPI) scaling. This parameter may be set to NULL.

[in] iPartId

Type: int

Value of type int that specifies the part that contains the region. See Parts and States.

[in] iStateId

Type: int

Value of type int that specifies the state of the part. See Parts and States.

[in] pRect

Type: LPCRECT

Pointer to a RECT structure that contains, in logical coordinates, the specified rectangle used to compute the region.

[out] pRegion

Type: HRGN*

Pointer to the handle to the computed region.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The region handle that is returned by this function should be released when it is no longer needed, using DeleteObject.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header uxtheme.h
Library UxTheme.lib
DLL UxTheme.dll

See also

Other Resources

Property Identifiers

Reference

Regions