Partager via


GetThemeBackgroundExtent (Windows Embedded CE 6.0)

1/6/2010

This function calculates the size and location of the specified themed background, given the content area.

Syntax

HRESULT GetThemeBackgroundExtent(
  HTHEME hTheme,
  HDC hdc,
  int iPartId,
  int iStateId,
  const RECT* pContentRect,
  const RECT* pExtentRect
);

Parameters

  • hTheme
    [in] Handle to a window's specified theme data. To create a theme data handle, use OpenThemeDataEx.
  • hdc
    [in] Handle to a device context (HDC) used for drawing the background image. This parameter is optional and may be set to NULL.
  • iPartId
    [in] Integer value that specifies the part that contains the content. For more information, see Theme Parts and States.
  • iStateId
    [in] Integer value that specifies the state of the part that contains the content. For more information, see Theme Parts and States.
  • pContentRect
    [in] Pointer to a RECT structure that contains the rectangle, in logical coordinates, in which the background image is drawn.
  • pExtentRect
    [out] Pointer to a RECT structure that receives the logical coordinates of the background rectangle. This rectangle is based on pContentRect.

Return Value

Returns S_OK if successful, or E_FAIL otherwise.

Remarks

A theme can define a content area within each background image. This is the area where content such as text and icons can be placed without overwriting background borders.

MSHTML passes the logical coordinates of the bounding rectangle in RECT. RECT is modified by GetThemeBackgroundExtent and returned in pExtentRect.

Requirements

Header uxtheme.h
Library Ietheme.dll
Windows Embedded CE Windows CE 5.0 and later

See Also

Concepts

Theme Support Reference

Other Resources

Theme Support Functions