DrawThemeBackground Function


This is preliminary documentation and is subject to change.

Draws the theme-defined background image for the specified control part.

Syntax

HRESULT DrawThemeBackground(
    HTHEME hTheme, 
    HDC hdc, 
    int iPartId, 
    int iStateId, 
    const RECT *pRect, 
    DWORD dwBgFlags
);

Parameters

hTheme
Handle to a window's specified theme data. Use OpenThemeData to create an HTHEME.
hdc
Handle to a device context used for drawing the theme-defined background image.
iPartId
Integer that specifies the part to draw.
iStateId
Integer that specifies the state of the part to draw.
pRect
Pointer to a RECT structure that contains the rectangle, in logical coordinates, in which the background image is drawn.
dwBgFlags
Reserved. Must be set to 0.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

Controls and windows are defined in drawable parts, such as a parent part and zero or more child parts. Each part has a state, for example disabled, active, or selected.

Drawing operations are scaled to fit and not exceed the rectangle specified in pRect.

The theme-defined background can be based on a bitmap file, a border, or fill pattern.

Function Information

Stock ImplementationUxTheme.dll
Custom ImplementationNo
HeaderThemeApi.h
Import libraryUxTheme.lib
Minimum operating systems Windows NT Whistler


© 2000 Microsoft Corporation. All rights reserved. Terms of use.