DrawThemeBackground function
Return to Introduction  Previous page  Next page

function DrawThemeBackground(Theme: hTheme; DC: hDC; iPartId, iStateId: Integer; const Rect: TRect; pClipRect: PRect): hResult;  

The DrawThemeBackground function draws the background image defined by the visual style for the specified control part.  
ThemeHandle to a window's specified theme data. Use OpenThemeData to create an HTHEME.  
DCHandle to a device context (HDC) used for drawing the theme-defined background image.  
iPartIdValue of type int that specifies the part to draw.  
iStateIdValue of type int that specifies the state of the part to draw.  
RectA TRect structure that contains the rectangle, in logical coordinates, in which the background image is drawn.  
pClipRectPointer to a RECT structure that contains a clipping rectangle. This parameter may be set to NULL.  
Function returns S_OK if successful, or an error value otherwise.  
Drawing operations are scaled to fit and not exceed the rectangle specified in pRect. Your application should not draw outside the rectangle specified by pClipRect.  
The background defined by the visual style can be based on a bitmap file, a border, or fill pattern.  

See also
IsXPThemeEnabled, OpenThemeData, CloseThemeData, DrawThemeParentBackground and DrawThemedControl functions.