Export (0) Print
Expand All
Expand Minimize

DrawThemeParentBackground function

Draws the part of a parent control that is covered by a partially-transparent or alpha-blended child control.

Syntax


HRESULT DrawThemeParentBackground(
  _In_  HWND hwnd,
  _In_  HDC hdc,
  _In_  const RECT *prc
);

Parameters

hwnd [in]

Type: HWND

The child control.

hdc [in]

Type: HDC

The child control's DC.

prc [in]

Type: const RECT*

The area to be drawn. The rectangle is in the child window's coordinates. If this parameter is NULL, the area to be drawn includes the entire area occupied by the child control.

Return value

Type: HRESULT

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

Examples

Prior to calling DrawThemeBackground to draw the background image for a window, you may call IsThemeBackgroundPartiallyTransparent. This method determines whether DrawThemeParentBackground should be called to draw in backgrounds behind partially-transparent or alpha-blended child controls, and is demonstrated in the following example.


if (_hTheme)
{
  if (IsThemeBackgroundPartiallyTransparent(_hTheme, BP_PUSHBUTTON, _iStateId))
  {
    DrawThemeParentBackground(_hwnd, hdcPaint, prcPaint);
  }

  DrawThemeBackground(_hTheme,
                    hdcPaint,
                    BP_PUSHBUTTON,
                    _iStateId,
                    &rcClient,
                    prcPaint);
}


Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Uxtheme.h

Library

UxTheme.lib

DLL

UxTheme.dll

 

 

Community Additions

ADD
Show:
© 2014 Microsoft