Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Windows Controls
Visual Styles
Functions
 DrawThemeParentBackground Function
DrawThemeParentBackground Function

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);
}

Function Information

Stock ImplementationUxTheme.dll
Custom ImplementationNo
Headeruxtheme.h
Import libraryUxTheme.lib
Minimum operating systems Windows XP
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Missing Return Value explanation      XenonOfArcticus ... Thomas Lee   |   Edit   |   Show History
This documentation makes no mention of the meanings of the HRESULT return value.
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker