Draws the part of a parent control that is covered by a partially-transparent or alpha-blended child control.
Syntax
HRESULT DrawThemeParentBackground( HWND hwnd, HDC hdc, const RECT *prc );
Parameters
hwnd [in] Handle of the child control.hdc [in] Handle to the child control's device context (DC).prc [in] Pointer to a RECT structure that defines the area to be drawn. The rectangle is in the child window's coordinates. This parameter may be set to NULL.
Return Value
Returns S_OK if successful, or an error value otherwise.
Example
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); }
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); }
Function Information
Stock ImplementationUxTheme.dllCustom ImplementationNoHeaderuxtheme.hImport libraryUxTheme.libMinimum operating systems Windows XP