Headers diff for uxtheme.dll between 6.00.3790.3959-Windows 5.0 and 6.0.6001.18000-Windows 6.0 versions



 uxtheme.h (6.00.3790.3959-Windows 5.0)   uxtheme.h (6.0.6001.18000-Windows 6.0) 
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//
// uxtheme.h - theming API header file.
//
// Copyright (c) Microsoft Corporation. All rights reserved. // Copyright (c) Microsoft Corporation. All rights reserved.
// //
// File : uxtheme.h
// Version: 1.0
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#ifndef _UXTHEME_H_ #ifndef _UXTHEME_H_
#define _UXTHEME_H_ #define _UXTHEME_H_
//---------------------------------------------------------------------------
#include <commctrl.h> #include <commctrl.h>
//--------------------------------------------------------------------------- #include <SpecStrings.h>
//#if (_WIN32_WINNT >= 0x0500) // only available on XP
//---------------------------------------------------------------------------
// Define API decoration for direct importing of DLL references.
#ifndef THEMEAPI #ifndef THEMEAPI
#if !defined(_UXTHEME_) #if !defined(_UXTHEME_)
#define THEMEAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE #define THEMEAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
#define THEMEAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE #define THEMEAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
#else #else
#define THEMEAPI STDAPI #define THEMEAPI STDAPI
#define THEMEAPI_(type) STDAPI_(type) #define THEMEAPI_(type) STDAPI_(type)
#endif #endif /* _UXTHEME_ */
#endif // THEMEAPI #endif /* THEMEAPI */
//---------------------------------------------------------------------------
typedef HANDLE HTHEME; // handle to a section of theme data for class typedef HANDLE HTHEME; // handle to a section of theme data for class
#define MAX_THEMECOLOR 64
#define MAX_THEMESIZE 64
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// NOTE: PartId's and StateId's used in the theme API are defined in the // NOTE: PartId's and StateId's used in the theme API are defined in the
// hdr file <tmschema.h> using the TM_PART and TM_STATE macros. For // hdr file <vssym32.h> using the TM_PART and TM_STATE macros. For
// example, "TM_PART(BP, PUSHBUTTON)" defines the PartId "BP_PUSHBUTTON". // example, "TM_PART(BP, PUSHBUTTON)" defines the PartId "BP_PUSHBUTTON".
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// OpenThemeData() - Open the theme data for the specified HWND and // OpenThemeData() - Open the theme data for the specified HWND and
// semi-colon separated list of class names. // semi-colon separated list of class names.
// //
// OpenThemeData() will try each class name, one at // OpenThemeData() will try each class name, one at
// a time, and use the first matching theme info // a time, and use the first matching theme info
// found. If a match is found, a theme handle // found. If a match is found, a theme handle
// to the data is returned. If no match is found, // to the data is returned. If no match is found,
skipping to change at line 62 skipping to change at line 65
// theme handle associated with the matching class. // theme handle associated with the matching class.
// This param is a list (instead of just a single // This param is a list (instead of just a single
// class name) to provide the class an opportunity // class name) to provide the class an opportunity
// to get the "best" match between the class and // to get the "best" match between the class and
// the current theme. For example, a button might // the current theme. For example, a button might
// pass L"OkButton, Button" if its ID=ID_OK. If // pass L"OkButton, Button" if its ID=ID_OK. If
// the current theme has an entry for OkButton, // the current theme has an entry for OkButton,
// that will be used. Otherwise, we fall back on // that will be used. Otherwise, we fall back on
// the normal Button entry. // the normal Button entry.
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI_(HTHEME) OpenThemeData(HWND hwnd, LPCWSTR pszClassList); THEMEAPI_(HTHEME)
OpenThemeData(
HWND hwnd,
LPCWSTR pszClassList
);
#define OTD_FORCE_RECT_SIZING 0x00000001 // make all parts size to re
ct
#define OTD_NONCLIENT 0x00000002 // set if hTheme to be used
for nonclient area
#define OTD_VALIDBITS (OTD_FORCE_RECT_SIZING | \
OTD_NONCLIENT)
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// CloseTHemeData() - closes the theme data handle. This should be done // OpenThemeDataEx - Open the theme data for the specified HWND and
// semi-colon separated list of class names.
//
// OpenThemeData() will try each class name, one at
// a time, and use the first matching theme info
// found. If a match is found, a theme handle
// to the data is returned. If no match is found,
// a "NULL" handle is returned.
//
// When the window is destroyed or a WM_THEMECHANGED
// msg is received, "CloseThemeData()" should be
// called to close the theme handle.
//
// hwnd - window handle of the control/window to be themed
//
// pszClassList - class name (or list of names) to match to theme data
// section. if the list contains more than one name,
// the names are tested one at a time for a match.
// If a match is found, OpenThemeData() returns a
// theme handle associated with the matching class.
// This param is a list (instead of just a single
// class name) to provide the class an opportunity
// to get the "best" match between the class and
// the current theme. For example, a button might
// pass L"OkButton, Button" if its ID=ID_OK. If
// the current theme has an entry for OkButton,
// that will be used. Otherwise, we fall back on
// the normal Button entry.
//
// dwFlags - allows certain overrides of std features
// (see OTD_XXX defines above)
//---------------------------------------------------------------------------
THEMEAPI_(HTHEME)
OpenThemeDataEx(
HWND hwnd,
LPCWSTR pszClassList,
DWORD dwFlags
);
//---------------------------------------------------------------------------
// CloseThemeData() - closes the theme data handle. This should be done
// when the window being themed is destroyed or // when the window being themed is destroyed or
// whenever a WM_THEMECHANGED msg is received // whenever a WM_THEMECHANGED msg is received
// (followed by an attempt to create a new Theme data // (followed by an attempt to create a new Theme data
// handle). // handle).
// //
// hTheme - open theme data handle (returned from prior call // hTheme - open theme data handle (returned from prior call
// to OpenThemeData() API). // to OpenThemeData() API).
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI CloseThemeData(HTHEME hTheme); THEMEAPI
CloseThemeData(
HTHEME hTheme
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// functions for basic drawing support // functions for basic drawing support
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// The following methods are the theme-aware drawing services. // The following methods are the theme-aware drawing services.
// Controls/Windows are defined in drawable "parts" by their author: a // Controls/Windows are defined in drawable "parts" by their author: a
// parent part and 0 or more child parts. Each of the parts can be // parent part and 0 or more child parts. Each of the parts can be
// described in "states" (ex: disabled, hot, pressed). // described in "states" (ex: disabled, hot, pressed).
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// For the list of all themed classes and the definition of all // For the list of all themed classes and the definition of all
skipping to change at line 110 skipping to change at line 165
// based on a bitmap file, a border and fill, or // based on a bitmap file, a border and fill, or
// other image description. // other image description.
// //
// hTheme - theme data handle // hTheme - theme data handle
// hdc - HDC to draw into // hdc - HDC to draw into
// iPartId - part number to draw // iPartId - part number to draw
// iStateId - state number (of the part) to draw // iStateId - state number (of the part) to draw
// pRect - defines the size/location of the part // pRect - defines the size/location of the part
// pClipRect - optional clipping rect (don't draw outside it) // pClipRect - optional clipping rect (don't draw outside it)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
THEMEAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, THEMEAPI
int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect DrawThemeBackground(
); HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
LPCRECT pRect,
__in_opt LPCRECT pClipRect
);
//------------------------------------------------------------------------
//---- bits used in dwFlags of DTBGOPTS ----
#define DTBG_CLIPRECT 0x00000001 // rcClip has been specified
#define DTBG_DRAWSOLID 0x00000002 // DEPRECATED: draw transparent/alph
a images as solid
#define DTBG_OMITBORDER 0x00000004 // don't draw border of part
#define DTBG_OMITCONTENT 0x00000008 // don't draw content area of part
#define DTBG_COMPUTINGREGION 0x00000010 // TRUE if calling to compute region
#define DTBG_MIRRORDC 0x00000020 // assume the hdc is mirrorred and
// flip images as appropriate (curre
ntly
// only supported for bgtype=imagefi
le)
#define DTBG_NOMIRROR 0x00000040 // don't mirror the output, override
s everything else
#define DTBG_VALIDBITS (DTBG_CLIPRECT | \
DTBG_DRAWSOLID | \
DTBG_OMITBORDER | \
DTBG_OMITCONTENT | \
DTBG_COMPUTINGREGION | \
DTBG_MIRRORDC | \
DTBG_NOMIRROR)
typedef struct _DTBGOPTS
{
DWORD dwSize; // size of the struct
DWORD dwFlags; // which options have been specified
RECT rcClip; // clipping rectangle
} DTBGOPTS, *PDTBGOPTS;
//------------------------------------------------------------------------
// DrawThemeBackgroundEx()
// - draws the theme-specified border and fill for
// the "iPartId" and "iStateId". This could be
// based on a bitmap file, a border and fill, or
// other image description. NOTE: This will be
// merged back into DrawThemeBackground() after
// BETA 2.
//
// hTheme - theme data handle
// hdc - HDC to draw into
// iPartId - part number to draw
// iStateId - state number (of the part) to draw
// pRect - defines the size/location of the part
// pOptions - ptr to optional params
//------------------------------------------------------------------------
THEMEAPI
DrawThemeBackgroundEx(
HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
LPCRECT pRect,
__in_opt const DTBGOPTS *pOptions
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//----- DrawThemeText() flags ---- //----- DrawThemeText() flags ----
#define DTT_GRAYED 0x00000001 // draw a grayed-out string
#define DTT_GRAYED 0x1 // draw a grayed-out string (this is deprecated)
#define DTT_FLAGS2VALIDBITS (DTT_GRAYED)
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// DrawThemeText() - draws the text using the theme-specified // DrawThemeText() - draws the text using the theme-specified
// color and font for the "iPartId" and // color and font for the "iPartId" and
// "iStateId". // "iStateId".
// //
// hTheme - theme data handle // hTheme - theme data handle
// hdc - HDC to draw into // hdc - HDC to draw into
// iPartId - part number to draw // iPartId - part number to draw
// iStateId - state number (of the part) to draw // iStateId - state number (of the part) to draw
// pszText - actual text to draw // pszText - actual text to draw
// dwCharCount - number of chars to draw (-1 for all) // dwCharCount - number of chars to draw (-1 for all)
// dwTextFlags - same as DrawText() "uFormat" param // dwTextFlags - same as DrawText() "uFormat" param
// dwTextFlags2 - additional drawing options // dwTextFlags2 - additional drawing options
// pRect - defines the size/location of the part // pRect - defines the size/location of the part
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
THEMEAPI DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, THEMEAPI
int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DrawThemeText(
DWORD dwTextFlags2, const RECT *pRect); HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
__in_ecount(cchText) LPCWSTR pszText,
int cchText,
DWORD dwTextFlags,
DWORD dwTextFlags2,
LPCRECT pRect
);
//---------------------------------------------------------------------------
//
// DrawThemeTextEx
//
// Callback function used by DrawTextWithGlow instead of DrawTextW
typedef
int
(WINAPI *DTT_CALLBACK_PROC)
(
__in HDC hdc,
__inout_ecount(cchText) LPWSTR pszText,
__in int cchText,
__inout LPRECT prc,
__in UINT dwFlags,
__in LPARAM lParam);
//---- bits used in dwFlags of DTTOPTS ----
#define DTT_TEXTCOLOR (1UL << 0) // crText has been specified
#define DTT_BORDERCOLOR (1UL << 1) // crBorder has been specified
#define DTT_SHADOWCOLOR (1UL << 2) // crShadow has been specified
#define DTT_SHADOWTYPE (1UL << 3) // iTextShadowType has been specifie
d
#define DTT_SHADOWOFFSET (1UL << 4) // ptShadowOffset has been specified
#define DTT_BORDERSIZE (1UL << 5) // iBorderSize has been specified
#define DTT_FONTPROP (1UL << 6) // iFontPropId has been specified
#define DTT_COLORPROP (1UL << 7) // iColorPropId has been specified
#define DTT_STATEID (1UL << 8) // IStateId has been specified
#define DTT_CALCRECT (1UL << 9) // Use pRect as and in/out parameter
#define DTT_APPLYOVERLAY (1UL << 10) // fApplyOverlay has been specified
#define DTT_GLOWSIZE (1UL << 11) // iGlowSize has been specified
#define DTT_CALLBACK (1UL << 12) // pfnDrawTextCallback has been spec
ified
#define DTT_COMPOSITED (1UL << 13) // Draws text with antialiased alpha
(needs a DIB section)
#define DTT_VALIDBITS (DTT_TEXTCOLOR | \
DTT_BORDERCOLOR | \
DTT_SHADOWCOLOR | \
DTT_SHADOWTYPE | \
DTT_SHADOWOFFSET | \
DTT_BORDERSIZE | \
DTT_FONTPROP | \
DTT_COLORPROP | \
DTT_STATEID | \
DTT_CALCRECT | \
DTT_APPLYOVERLAY | \
DTT_GLOWSIZE | \
DTT_COMPOSITED)
typedef struct _DTTOPTS
{
DWORD dwSize; // size of the struct
DWORD dwFlags; // which options have been specified
COLORREF crText; // color to use for text fill
COLORREF crBorder; // color to use for text outline
COLORREF crShadow; // color to use for text shadow
int iTextShadowType; // TST_SINGLE or TST_CONTINUOUS
POINT ptShadowOffset; // where shadow is drawn (relative to
text)
int iBorderSize; // Border radius around text
int iFontPropId; // Font property to use for the text
instead of TMT_FONT
int iColorPropId; // Color property to use for the text
instead of TMT_TEXTCOLOR
int iStateId; // Alternate state id
BOOL fApplyOverlay; // Overlay text on top of any text ef
fect?
int iGlowSize; // Glow radious around text
DTT_CALLBACK_PROC pfnDrawTextCallback; // Callback for DrawText
LPARAM lParam; // Parameter for callback
} DTTOPTS, *PDTTOPTS;
THEMEAPI
DrawThemeTextEx(
HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
__in_ecount(cchText) LPCWSTR pszText,
int cchText,
DWORD dwTextFlags,
__inout LPRECT pRect,
__in_opt const DTTOPTS *pOptions
);
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// GetThemeBackgroundContentRect() // GetThemeBackgroundContentRect()
// - gets the size of the content for the theme-defined // - gets the size of the content for the theme-defined
// background. This is usually the area inside // background. This is usually the area inside
// the borders or Margins. // the borders or Margins.
// //
// hTheme - theme data handle // hTheme - theme data handle
// hdc - (optional) device content to be used for drawing // hdc - (optional) device content to be used for drawing
// iPartId - part number to draw // iPartId - part number to draw
// iStateId - state number (of the part) to draw // iStateId - state number (of the part) to draw
// pBoundingRect - the outer RECT of the part being drawn // pBoundingRect - the outer RECT of the part being drawn
// pContentRect - RECT to receive the content area // pContentRect - RECT to receive the content area
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
THEMEAPI GetThemeBackgroundContentRect(HTHEME hTheme, OPTIONAL HDC hdc, THEMEAPI
int iPartId, int iStateId, const RECT *pBoundingRect, GetThemeBackgroundContentRect(
OUT RECT *pContentRect); HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
LPCRECT pBoundingRect,
__out LPRECT pContentRect
);
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// GetThemeBackgroundExtent() - calculates the size/location of the theme- // GetThemeBackgroundExtent() - calculates the size/location of the theme-
// specified background based on the // specified background based on the
// "pContentRect". // "pContentRect".
// //
// hTheme - theme data handle // hTheme - theme data handle
// hdc - (optional) device content to be used for drawing // hdc - (optional) device content to be used for drawing
// iPartId - part number to draw // iPartId - part number to draw
// iStateId - state number (of the part) to draw // iStateId - state number (of the part) to draw
// pContentRect - RECT that defines the content area // pContentRect - RECT that defines the content area
// pBoundingRect - RECT to receive the overall size/location of part // pBoundingRect - RECT to receive the overall size/location of part
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
THEMEAPI GetThemeBackgroundExtent(HTHEME hTheme, OPTIONAL HDC hdc, THEMEAPI
int iPartId, int iStateId, const RECT *pContentRect, GetThemeBackgroundExtent(
OUT RECT *pExtentRect); HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
LPCRECT pContentRect,
__out LPRECT pExtentRect
);
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
typedef enum THEMESIZE // GetThemeBackgroundRegion()
// - computes the region for a regular or partially
// transparent theme-specified background that is
// bound by the specified "pRect".
// If the rectangle is empty, sets the HRGN to NULL
// and return S_FALSE.
//
// hTheme - theme data handle
// hdc - optional HDC to draw into (DPI scaling)
// iPartId - part number to draw
// iStateId - state number (of the part)
// pRect - the RECT used to draw the part
// pRegion - receives handle to calculated region
//-------------------------------------------------------------------------
THEMEAPI
GetThemeBackgroundRegion(
HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
LPCRECT pRect,
__out HRGN *pRegion
);
enum THEMESIZE
{ {
TS_MIN, // minimum size TS_MIN, // minimum size
TS_TRUE, // size without stretching TS_TRUE, // size without stretching
TS_DRAW, // size that theme mgr will use to draw part TS_DRAW // size that theme mgr will use to draw part
}; };
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// GetThemePartSize() - returns the specified size of the theme part // GetThemePartSize() - returns the specified size of the theme part
// //
// hTheme - theme data handle // hTheme - theme data handle
// hdc - HDC to select font into & measure against // hdc - HDC to select font into & measure against
// iPartId - part number to retrieve size for // iPartId - part number to retrieve size for
// iStateId - state number (of the part) // iStateId - state number (of the part)
// prc - (optional) rect for part drawing destination // prc - (optional) rect for part drawing destination
// eSize - the type of size to be retreived // eSize - the type of size to be retreived
// psz - receives the specified size of the part // psz - receives the specified size of the part
skipping to change at line 188 skipping to change at line 426
// GetThemePartSize() - returns the specified size of the theme part // GetThemePartSize() - returns the specified size of the theme part
// //
// hTheme - theme data handle // hTheme - theme data handle
// hdc - HDC to select font into & measure against // hdc - HDC to select font into & measure against
// iPartId - part number to retrieve size for // iPartId - part number to retrieve size for
// iStateId - state number (of the part) // iStateId - state number (of the part)
// prc - (optional) rect for part drawing destination // prc - (optional) rect for part drawing destination
// eSize - the type of size to be retreived // eSize - the type of size to be retreived
// psz - receives the specified size of the part // psz - receives the specified size of the part
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
THEMEAPI GetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, THEMEAPI
OPTIONAL RECT *prc, enum THEMESIZE eSize, OUT SIZE *psz); GetThemePartSize(
HTHEME hTheme,
__in_opt HDC hdc,
int iPartId,
int iStateId,
__in_opt LPCRECT prc,
enum THEMESIZE eSize,
__out SIZE *psz
);
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// GetThemeTextExtent() - calculates the size/location of the specified // GetThemeTextExtent() - calculates the size/location of the specified
// text when rendered in the Theme Font. // text when rendered in the Theme Font.
// //
// hTheme - theme data handle // hTheme - theme data handle
// hdc - HDC to select font & measure into // hdc - HDC to select font & measure into
// iPartId - part number to draw // iPartId - part number to draw
// iStateId - state number (of the part) // iStateId - state number (of the part)
// pszText - the text to be measured // pszText - the text to be measured
// dwCharCount - number of chars to draw (-1 for all) // dwCharCount - number of chars to draw (-1 for all)
// dwTextFlags - same as DrawText() "uFormat" param // dwTextFlags - same as DrawText() "uFormat" param
// pszBoundingRect - optional: to control layout of text // pszBoundingRect - optional: to control layout of text
// pszExtentRect - receives the RECT for text size/location // pszExtentRect - receives the RECT for text size/location
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
THEMEAPI GetThemeTextExtent(HTHEME hTheme, HDC hdc, THEMEAPI
int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, GetThemeTextExtent(
DWORD dwTextFlags, OPTIONAL const RECT *pBoundingRect, HTHEME hTheme,
OUT RECT *pExtentRect); HDC hdc,
int iPartId,
int iStateId,
__in_ecount(cchCharCount) LPCWSTR pszText,
int cchCharCount,
DWORD dwTextFlags,
__in_opt LPCRECT pBoundingRect,
__out LPRECT pExtentRect
);
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// GetThemeTextMetrics() // GetThemeTextMetrics()
// - returns info about the theme-specified font // - returns info about the theme-specified font
// for the part/state passed in. // for the part/state passed in.
// //
// hTheme - theme data handle // hTheme - theme data handle
// hdc - optional: HDC for screen context // hdc - optional: HDC for screen context
// iPartId - part number to draw // iPartId - part number to draw
// iStateId - state number (of the part) // iStateId - state number (of the part)
// ptm - receives the font info // ptm - receives the font info
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
THEMEAPI GetThemeTextMetrics(HTHEME hTheme, OPTIONAL HDC hdc, THEMEAPI
int iPartId, int iStateId, OUT TEXTMETRIC* ptm); GetThemeTextMetrics(
HTHEME hTheme,
//------------------------------------------------------------------------- HDC hdc,
// GetThemeBackgroundRegion() int iPartId,
// - computes the region for a regular or partially int iStateId,
// transparent theme-specified background that is __out TEXTMETRICW *ptm
// bound by the specified "pRect". );
// If the rectangle is empty, sets the HRGN to NULL
// and return S_FALSE.
//
// hTheme - theme data handle
// hdc - optional HDC to draw into (DPI scaling)
// iPartId - part number to draw
// iStateId - state number (of the part)
// pRect - the RECT used to draw the part
// pRegion - receives handle to calculated region
//-------------------------------------------------------------------------
THEMEAPI GetThemeBackgroundRegion(HTHEME hTheme, OPTIONAL HDC hdc,
int iPartId, int iStateId, const RECT *pRect, OUT HRGN *pRegion);
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//----- HitTestThemeBackground, HitTestThemeBackgroundRegion flags ---- //----- HitTestThemeBackground, HitTestThemeBackgroundRegion flags ----
// Theme background segment hit test flag (default). possible return values are : // Theme background segment hit test flag (default). possible return values are :
// HTCLIENT: hit test succeeded in the middle background segment // HTCLIENT: hit test succeeded in the middle background segment
// HTTOP, HTLEFT, HTTOPLEFT, etc: // hit test succeeded in the the respective theme background segment. // HTTOP, HTLEFT, HTTOPLEFT, etc: // hit test succeeded in the the respective theme background segment.
#define HTTB_BACKGROUNDSEG 0x0000 #define HTTB_BACKGROUNDSEG 0x00000000
// Fixed border hit test option. possible return values are: // Fixed border hit test option. possible return values are:
// HTCLIENT: hit test succeeded in the middle background segment // HTCLIENT: hit test succeeded in the middle background segment
// HTBORDER: hit test succeeded in any other background segment // HTBORDER: hit test succeeded in any other background segment
#define HTTB_FIXEDBORDER 0x0002 // Return code may be either HTCLIEN #define HTTB_FIXEDBORDER 0x00000002 // Return code may be either
T or HTBORDER. HTCLIENT or HTBORDER.
// Caption hit test option. Possible return values are: // Caption hit test option. Possible return values are:
// HTCAPTION: hit test succeeded in the top, top left, or top right background segments // HTCAPTION: hit test succeeded in the top, top left, or top right background segments
// HTNOWHERE or another return code, depending on absence or presence of accomp anying flags, resp. // HTNOWHERE or another return code, depending on absence or presence of accomp anying flags, resp.
#define HTTB_CAPTION 0x0004 #define HTTB_CAPTION 0x00000004
// Resizing border hit test flags. Possible return values are: // Resizing border hit test flags. Possible return values are:
// HTCLIENT: hit test succeeded in middle background segment // HTCLIENT: hit test succeeded in middle background segment
// HTTOP, HTTOPLEFT, HTLEFT, HTRIGHT, etc: hit test succeeded in the respect ive system resizing zone // HTTOP, HTTOPLEFT, HTLEFT, HTRIGHT, etc: hit test succeeded in the respect ive system resizing zone
// HTBORDER: hit test failed in middle segment and resizing zones, but succeede d in a background border segment // HTBORDER: hit test failed in middle segment and resizing zones, but succeede d in a background border segment
#define HTTB_RESIZINGBORDER_LEFT 0x0010 // Hit test left resizing border, #define HTTB_RESIZINGBORDER_LEFT 0x00000010 // Hit test left resizing bo
#define HTTB_RESIZINGBORDER_TOP 0x0020 // Hit test top resizing border rder,
#define HTTB_RESIZINGBORDER_RIGHT 0x0040 // Hit test right resizing border #define HTTB_RESIZINGBORDER_TOP 0x00000020 // Hit test top resizing bor
#define HTTB_RESIZINGBORDER_BOTTOM 0x0080 // Hit test bottom resizing border der
#define HTTB_RESIZINGBORDER_RIGHT 0x00000040 // Hit test right resizing b
#define HTTB_RESIZINGBORDER (HTTB_RESIZINGBORDER_LEFT|HTTB_RESIZINGBORDE order
R_TOP|\ #define HTTB_RESIZINGBORDER_BOTTOM 0x00000080 // Hit test bottom resizing
HTTB_RESIZINGBORDER_RIGHT|HTTB_RESIZINGBORD border
ER_BOTTOM) #define HTTB_RESIZINGBORDER (HTTB_RESIZINGBORDER_LEFT | \
HTTB_RESIZINGBORDER_TOP | \
HTTB_RESIZINGBORDER_RIGHT | \
HTTB_RESIZINGBORDER_BOTTOM)
// Resizing border is specified as a template, not just window edges. // Resizing border is specified as a template, not just window edges.
// This option is mutually exclusive with HTTB_SYSTEMSIZINGWIDTH; HTTB_SIZINGTEM PLATE takes precedence // This option is mutually exclusive with HTTB_SYSTEMSIZINGWIDTH; HTTB_SIZINGTEM PLATE takes precedence
#define HTTB_SIZINGTEMPLATE 0x0100 #define HTTB_SIZINGTEMPLATE 0x00000100
// Use system resizing border width rather than theme content margins. // Use system resizing border width rather than theme content margins.
// This option is mutually exclusive with HTTB_SIZINGTEMPLATE, which takes prece dence. // This option is mutually exclusive with HTTB_SIZINGTEMPLATE, which takes prece dence.
#define HTTB_SYSTEMSIZINGMARGINS 0x0200 #define HTTB_SYSTEMSIZINGMARGINS 0x00000200
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// HitTestThemeBackground() // HitTestThemeBackground()
// - returns a HitTestCode (a subset of the values // - returns a HitTestCode (a subset of the values
// returned by WM_NCHITTEST) for the point "ptTest" // returned by WM_NCHITTEST) for the point "ptTest"
// within the theme-specified background // within the theme-specified background
// (bound by pRect). "pRect" and "ptTest" should // (bound by pRect). "pRect" and "ptTest" should
// both be in the same coordinate system // both be in the same coordinate system
// (client, screen, etc). // (client, screen, etc).
// //
skipping to change at line 304 skipping to change at line 542
// hrgn - optional region to use; must be in same coordinates as // hrgn - optional region to use; must be in same coordinates as
// - pRect and pTest. // - pRect and pTest.
// ptTest - the hit point to be tested // ptTest - the hit point to be tested
// dwOptions - HTTB_xxx constants // dwOptions - HTTB_xxx constants
// pwHitTestCode - receives the returned hit test code - one of: // pwHitTestCode - receives the returned hit test code - one of:
// //
// HTNOWHERE, HTLEFT, HTTOPLEFT, HTBOTTOMLEFT, // HTNOWHERE, HTLEFT, HTTOPLEFT, HTBOTTOMLEFT,
// HTRIGHT, HTTOPRIGHT, HTBOTTOMRIGHT, // HTRIGHT, HTTOPRIGHT, HTBOTTOMRIGHT,
// HTTOP, HTBOTTOM, HTCLIENT // HTTOP, HTBOTTOM, HTCLIENT
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
THEMEAPI HitTestThemeBackground(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, THEMEAPI
int iStateId, DWORD dwOptions, const RECT *pRect, OPTIONAL HRGN hrgn, HitTestThemeBackground(
POINT ptTest, OUT WORD *pwHitTestCode); HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
DWORD dwOptions,
LPCRECT pRect,
HRGN hrgn,
POINT ptTest,
__out WORD *pwHitTestCode
);
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// DrawThemeEdge() - Similar to the DrawEdge() API, but uses part colors // DrawThemeEdge() - Similar to the DrawEdge() API, but uses part colors
// and is high-DPI aware // and is high-DPI aware
// hTheme - theme data handle // hTheme - theme data handle
// hdc - HDC to draw into // hdc - HDC to draw into
// iPartId - part number to draw // iPartId - part number to draw
// iStateId - state number of part // iStateId - state number of part
// pDestRect - the RECT used to draw the line(s) // pDestRect - the RECT used to draw the line(s)
// uEdge - Same as DrawEdge() API // uEdge - Same as DrawEdge() API
// uFlags - Same as DrawEdge() API // uFlags - Same as DrawEdge() API
// pContentRect - Receives the interior rect if (uFlags & BF_ADJUST) // pContentRect - Receives the interior rect if (uFlags & BF_ADJUST)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
THEMEAPI DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, THEMEAPI
const RECT *pDestRect, UINT uEdge, UINT uFlags, OPTIONAL DrawThemeEdge(
OUT RECT *pContentRect); HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
LPCRECT pDestRect,
UINT uEdge,
UINT uFlags,
__out_opt LPRECT pContentRect
);
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// DrawThemeIcon() - draws an image within an imagelist based on // DrawThemeIcon() - draws an image within an imagelist based on
// a (possible) theme-defined effect. // a (possible) theme-defined effect.
// //
// hTheme - theme data handle // hTheme - theme data handle
// hdc - HDC to draw into // hdc - HDC to draw into
// iPartId - part number to draw // iPartId - part number to draw
// iStateId - state number of part // iStateId - state number of part
// pRect - the RECT to draw the image within // pRect - the RECT to draw the image within
// himl - handle to IMAGELIST // himl - handle to IMAGELIST
// iImageIndex - index into IMAGELIST (which icon to draw) // iImageIndex - index into IMAGELIST (which icon to draw)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
THEMEAPI DrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId, THEMEAPI
int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex); DrawThemeIcon(
HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
LPCRECT pRect,
HIMAGELIST himl,
int iImageIndex
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// IsThemePartDefined() - returns TRUE if the theme has defined parameters // IsThemePartDefined() - returns TRUE if the theme has defined parameters
// for the specified "iPartId" and "iStateId". // for the specified "iPartId" and "iStateId".
// //
// hTheme - theme data handle // hTheme - theme data handle
// iPartId - part number to find definition for // iPartId - part number to find definition for
// iStateId - state number of part // iStateId - state number of part
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI_(BOOL) IsThemePartDefined(HTHEME hTheme, int iPartId, THEMEAPI_(BOOL)
int iStateId); IsThemePartDefined(
HTHEME hTheme,
int iPartId,
int iStateId
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// IsThemeBackgroundPartiallyTransparent() // IsThemeBackgroundPartiallyTransparent()
// - returns TRUE if the theme specified background for // - returns TRUE if the theme specified background for
// the part/state has transparent pieces or // the part/state has transparent pieces or
// alpha-blended pieces. // alpha-blended pieces.
// //
// hTheme - theme data handle // hTheme - theme data handle
// iPartId - part number // iPartId - part number
// iStateId - state number of part // iStateId - state number of part
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI_(BOOL) IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, THEMEAPI_(BOOL)
int iPartId, int iStateId); IsThemeBackgroundPartiallyTransparent(
HTHEME hTheme,
int iPartId,
int iStateId
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// lower-level theme information services // lower-level theme information services
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// The following methods are getter routines for each of the Theme Data types. // The following methods are getter routines for each of the Theme Data types.
// Controls/Windows are defined in drawable "parts" by their author: a // Controls/Windows are defined in drawable "parts" by their author: a
// parent part and 0 or more child parts. Each of the parts can be // parent part and 0 or more child parts. Each of the parts can be
// described in "states" (ex: disabled, hot, pressed). // described in "states" (ex: disabled, hot, pressed).
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Each of the below methods takes a "iPartId" param to specify the // Each of the below methods takes a "iPartId" param to specify the
skipping to change at line 388 skipping to change at line 660
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// GetThemeColor() - Get the value for the specified COLOR property // GetThemeColor() - Get the value for the specified COLOR property
// //
// hTheme - theme data handle // hTheme - theme data handle
// iPartId - part number // iPartId - part number
// iStateId - state number of part // iStateId - state number of part
// iPropId - the property number to get the value for // iPropId - the property number to get the value for
// pColor - receives the value of the property // pColor - receives the value of the property
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
THEMEAPI GetThemeColor(HTHEME hTheme, int iPartId, THEMEAPI
int iStateId, int iPropId, OUT COLORREF *pColor); GetThemeColor(
HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId,
__out COLORREF *pColor
);
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// GetThemeMetric() - Get the value for the specified metric/size // GetThemeMetric() - Get the value for the specified metric/size
// property // property
// //
// hTheme - theme data handle // hTheme - theme data handle
// hdc - (optional) hdc to be drawn into (DPI scaling) // hdc - (optional) hdc to be drawn into (DPI scaling)
// iPartId - part number // iPartId - part number
// iStateId - state number of part // iStateId - state number of part
// iPropId - the property number to get the value for // iPropId - the property number to get the value for
// piVal - receives the value of the property // piVal - receives the value of the property
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
THEMEAPI GetThemeMetric(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, THEMEAPI
int iStateId, int iPropId, OUT int *piVal); GetThemeMetric(
HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
int iPropId,
__out int *piVal
);
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// GetThemeString() - Get the value for the specified string property // GetThemeString() - Get the value for the specified string property
// //
// hTheme - theme data handle // hTheme - theme data handle
// iPartId - part number // iPartId - part number
// iStateId - state number of part // iStateId - state number of part
// iPropId - the property number to get the value for // iPropId - the property number to get the value for
// pszBuff - receives the string property value // pszBuff - receives the string property value
// cchMaxBuffChars - max. number of chars allowed in pszBuff // cchMaxBuffChars - max. number of chars allowed in pszBuff
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
THEMEAPI GetThemeString(HTHEME hTheme, int iPartId, THEMEAPI
int iStateId, int iPropId, OUT LPWSTR pszBuff, int cchMaxBuffChars); GetThemeString(
HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId,
__out_ecount(cchMaxBuffChars) LPWSTR pszBuff,
int cchMaxBuffChars
);
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// GetThemeBool() - Get the value for the specified BOOL property // GetThemeBool() - Get the value for the specified BOOL property
// //
// hTheme - theme data handle // hTheme - theme data handle
// iPartId - part number // iPartId - part number
// iStateId - state number of part // iStateId - state number of part
// iPropId - the property number to get the value for // iPropId - the property number to get the value for
// pfVal - receives the value of the property // pfVal - receives the value of the property
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
THEMEAPI GetThemeBool(HTHEME hTheme, int iPartId, THEMEAPI
int iStateId, int iPropId, OUT BOOL *pfVal); GetThemeBool(
HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId,
__out BOOL *pfVal
);
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// GetThemeInt() - Get the value for the specified int property // GetThemeInt() - Get the value for the specified int property
// //
// hTheme - theme data handle // hTheme - theme data handle
// iPartId - part number // iPartId - part number
// iStateId - state number of part // iStateId - state number of part
// iPropId - the property number to get the value for // iPropId - the property number to get the value for
// piVal - receives the value of the property // piVal - receives the value of the property
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
THEMEAPI GetThemeInt(HTHEME hTheme, int iPartId, THEMEAPI
int iStateId, int iPropId, OUT int *piVal); GetThemeInt(
HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId,
__out int *piVal
);
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// GetThemeEnumValue() - Get the value for the specified ENUM property // GetThemeEnumValue() - Get the value for the specified ENUM property
// //
// hTheme - theme data handle // hTheme - theme data handle
// iPartId - part number // iPartId - part number
// iStateId - state number of part // iStateId - state number of part
// iPropId - the property number to get the value for // iPropId - the property number to get the value for
// piVal - receives the value of the enum (cast to int*) // piVal - receives the value of the enum (cast to int*)
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
THEMEAPI GetThemeEnumValue(HTHEME hTheme, int iPartId, THEMEAPI
int iStateId, int iPropId, OUT int *piVal); GetThemeEnumValue(
HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId,
__out int *piVal
);
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// GetThemePosition() - Get the value for the specified position // GetThemePosition() - Get the value for the specified position
// property // property
// //
// hTheme - theme data handle // hTheme - theme data handle
// iPartId - part number // iPartId - part number
// iStateId - state number of part // iStateId - state number of part
// iPropId - the property number to get the value for // iPropId - the property number to get the value for
// pPoint - receives the value of the position property // pPoint - receives the value of the position property
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
THEMEAPI GetThemePosition(HTHEME hTheme, int iPartId, THEMEAPI
int iStateId, int iPropId, OUT POINT *pPoint); GetThemePosition(
HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId,
__out POINT *pPoint
);
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// GetThemeFont() - Get the value for the specified font property // GetThemeFont() - Get the value for the specified font property
// //
// hTheme - theme data handle // hTheme - theme data handle
// hdc - (optional) hdc to be drawn to (DPI scaling) // hdc - (optional) hdc to be drawn to (DPI scaling)
// iPartId - part number // iPartId - part number
// iStateId - state number of part // iStateId - state number of part
// iPropId - the property number to get the value for // iPropId - the property number to get the value for
// pFont - receives the value of the LOGFONT property // pFont - receives the value of the LOGFONT property
// (scaled for the current logical screen dpi) // (scaled for the current logical screen dpi)
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
THEMEAPI GetThemeFont(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, THEMEAPI
int iStateId, int iPropId, OUT LOGFONT *pFont); GetThemeFont(
HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
int iPropId,
__out LOGFONTW *pFont
);
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// GetThemeRect() - Get the value for the specified RECT property // GetThemeRect() - Get the value for the specified RECT property
// //
// hTheme - theme data handle // hTheme - theme data handle
// iPartId - part number // iPartId - part number
// iStateId - state number of part // iStateId - state number of part
// iPropId - the property number to get the value for // iPropId - the property number to get the value for
// pRect - receives the value of the RECT property // pRect - receives the value of the RECT property
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
THEMEAPI GetThemeRect(HTHEME hTheme, int iPartId, THEMEAPI
int iStateId, int iPropId, OUT RECT *pRect); GetThemeRect(
HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId,
__out LPRECT pRect
);
//-----------------------------------------------------------------------
typedef struct _MARGINS typedef struct _MARGINS
{ {
int cxLeftWidth; // width of left border that retains its size int cxLeftWidth; // width of left border that retains its size
int cxRightWidth; // width of right border that retains its size int cxRightWidth; // width of right border that retains its size
int cyTopHeight; // height of top border that retains its size int cyTopHeight; // height of top border that retains its size
int cyBottomHeight; // height of bottom border that retains its size int cyBottomHeight; // height of bottom border that retains its size
} MARGINS, *PMARGINS; } MARGINS, *PMARGINS;
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// GetThemeMargins() - Get the value for the specified MARGINS property // GetThemeMargins() - Get the value for the specified MARGINS property
// //
// hTheme - theme data handle // hTheme - theme data handle
// hdc - (optional) hdc to be used for drawing // hdc - (optional) hdc to be used for drawing
// iPartId - part number // iPartId - part number
// iStateId - state number of part // iStateId - state number of part
// iPropId - the property number to get the value for // iPropId - the property number to get the value for
// prc - RECT for area to be drawn into // prc - RECT for area to be drawn into
// pMargins - receives the value of the MARGINS property // pMargins - receives the value of the MARGINS property
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
THEMEAPI GetThemeMargins(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, THEMEAPI
int iStateId, int iPropId, OPTIONAL RECT *prc, OUT MARGINS *pMargins); GetThemeMargins(
HTHEME hTheme,
__in_opt HDC hdc,
int iPartId,
int iStateId,
int iPropId,
__in_opt LPCRECT prc,
__out MARGINS *pMargins
);
//----------------------------------------------------------------------- #if WINVER >= 0x0600
#define MAX_INTLIST_COUNT 402
#else
#define MAX_INTLIST_COUNT 10 #define MAX_INTLIST_COUNT 10
#endif
typedef struct _INTLIST typedef struct _INTLIST
{ {
int iValueCount; // number of values in iValues int iValueCount; // number of values in iValues
int iValues[MAX_INTLIST_COUNT]; int iValues[MAX_INTLIST_COUNT];
} INTLIST, *PINTLIST; } INTLIST, *PINTLIST;
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// GetThemeIntList() - Get the value for the specified INTLIST struct // GetThemeIntList() - Get the value for the specified INTLIST struct
// //
// hTheme - theme data handle // hTheme - theme data handle
// iPartId - part number // iPartId - part number
// iStateId - state number of part // iStateId - state number of part
// iPropId - the property number to get the value for // iPropId - the property number to get the value for
// pIntList - receives the value of the INTLIST property // pIntList - receives the value of the INTLIST property
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
THEMEAPI GetThemeIntList(HTHEME hTheme, int iPartId, THEMEAPI
int iStateId, int iPropId, OUT INTLIST *pIntList); GetThemeIntList(
HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId,
__out INTLIST *pIntList
);
//----------------------------------------------------------------------- enum PROPERTYORIGIN
typedef enum PROPERTYORIGIN
{ {
PO_STATE, // property was found in the state section PO_STATE, // property was found in the state section
PO_PART, // property was found in the part section PO_PART, // property was found in the part section
PO_CLASS, // property was found in the class section PO_CLASS, // property was found in the class section
PO_GLOBAL, // property was found in [globals] section PO_GLOBAL, // property was found in [globals] section
PO_NOTFOUND // property was not found PO_NOTFOUND // property was not found
}; };
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// GetThemePropertyOrigin() // GetThemePropertyOrigin()
// - searches for the specified theme property // - searches for the specified theme property
// and sets "pOrigin" to indicate where it was // and sets "pOrigin" to indicate where it was
// found (or not found) // found (or not found)
// //
// hTheme - theme data handle // hTheme - theme data handle
// iPartId - part number // iPartId - part number
// iStateId - state number of part // iStateId - state number of part
// iPropId - the property number to search for // iPropId - the property number to search for
// pOrigin - receives the value of the property origin // pOrigin - receives the value of the property origin
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
THEMEAPI GetThemePropertyOrigin(HTHEME hTheme, int iPartId, THEMEAPI
int iStateId, int iPropId, OUT enum PROPERTYORIGIN *pOrigin); GetThemePropertyOrigin(
HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId,
__out enum PROPERTYORIGIN *pOrigin
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// SetWindowTheme() // SetWindowTheme()
// - redirects an existing Window to use a different // - redirects an existing Window to use a different
// section of the current theme information than its // section of the current theme information than its
// class normally asks for. // class normally asks for.
// //
// hwnd - the handle of the window (cannot be NULL) // hwnd - the handle of the window (cannot be NULL)
// //
// pszSubAppName - app (group) name to use in place of the calling // pszSubAppName - app (group) name to use in place of the calling
skipping to change at line 590 skipping to change at line 940
// "pszSubIdList" associations thru the lifetime of the window (even // "pszSubIdList" associations thru the lifetime of the window (even
// if themes are subsequently changed). The window is sent a // if themes are subsequently changed). The window is sent a
// "WM_THEMECHANGED" msg at the end of this call, so that the new // "WM_THEMECHANGED" msg at the end of this call, so that the new
// theme can be found and applied. // theme can be found and applied.
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// When "pszSubAppName" or "pszSubIdList" are NULL, the Theme Manager // When "pszSubAppName" or "pszSubIdList" are NULL, the Theme Manager
// removes the previously remember association. To turn off theme-ing for // removes the previously remember association. To turn off theme-ing for
// the specified window, you can pass an empty string (L"") so it // the specified window, you can pass an empty string (L"") so it
// won't match any section entries. // won't match any section entries.
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, THEMEAPI
LPCWSTR pszSubIdList); SetWindowTheme(
HWND hwnd,
LPCWSTR pszSubAppName,
LPCWSTR pszSubIdList
);
enum WINDOWTHEMEATTRIBUTETYPE
{
WTA_NONCLIENT = 1
};
typedef struct _WTA_OPTIONS
{
DWORD dwFlags; // values for each style option specified in the bit
mask
DWORD dwMask; // bitmask for flags that are changing
// valid options are: WTNCA_NODRAWCAPTION, WTNCA_NOD
RAWICON, WTNCA_NOSYSMENU
} WTA_OPTIONS, *PWTA_OPTIONS;
#define WTNCA_NODRAWCAPTION 0x00000001 // don't draw the window caption
#define WTNCA_NODRAWICON 0x00000002 // don't draw the system icon
#define WTNCA_NOSYSMENU 0x00000004 // don't expose the system menu
icon functionality
#define WTNCA_NOMIRRORHELP 0x00000008 // don't mirror the question mar
k, even in RTL layout
#define WTNCA_VALIDBITS (WTNCA_NODRAWCAPTION | \
WTNCA_NODRAWICON | \
WTNCA_NOSYSMENU | \
WTNCA_NOMIRRORHELP)
THEMEAPI
SetWindowThemeAttribute(
HWND hwnd,
enum WINDOWTHEMEATTRIBUTETYPE eAttribute,
__in_bcount(cbAttribute) PVOID pvAttribute,
DWORD cbAttribute
);
__inline HRESULT SetWindowThemeNonClientAttributes(HWND hwnd, DWORD dwMask, DWOR
D dwAttributes)
{
WTA_OPTIONS wta;
wta.dwFlags = dwAttributes;
wta.dwMask = dwMask;
return SetWindowThemeAttribute(hwnd, WTA_NONCLIENT, (void*)&(wta), sizeof(wt
a));
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// GetThemeFilename() - Get the value for the specified FILENAME property. // GetThemeFilename() - Get the value for the specified FILENAME property.
// //
// hTheme - theme data handle // hTheme - theme data handle
// iPartId - part number // iPartId - part number
// iStateId - state number of part // iStateId - state number of part
// iPropId - the property number to search for // iPropId - the property number to search for
// pszThemeFileName - output buffer to receive the filename // pszThemeFileName - output buffer to receive the filename
// cchMaxBuffChars - the size of the return buffer, in chars // cchMaxBuffChars - the size of the return buffer, in chars
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI GetThemeFilename(HTHEME hTheme, int iPartId, THEMEAPI
int iStateId, int iPropId, OUT LPWSTR pszThemeFileName, int cchMaxBuffChars) GetThemeFilename(
; HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId,
__out_ecount(cchMaxBuffChars) LPWSTR pszThemeFileName,
int cchMaxBuffChars
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// GetThemeSysColor() - Get the value of the specified System color. // GetThemeSysColor() - Get the value of the specified System color.
// //
// hTheme - the theme data handle. if non-NULL, will return // hTheme - the theme data handle. if non-NULL, will return
// color from [SysMetrics] section of theme. // color from [SysMetrics] section of theme.
// if NULL, will return the global system color. // if NULL, will return the global system color.
// //
// iColorId - the system color index defined in winuser.h // iColorId - the system color index defined in winuser.h
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI_(COLORREF) GetThemeSysColor(HTHEME hTheme, int iColorId); THEMEAPI_(COLORREF)
GetThemeSysColor(
HTHEME hTheme,
int iColorId
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// GetThemeSysColorBrush() // GetThemeSysColorBrush()
// - Get the brush for the specified System color. // - Get the brush for the specified System color.
// //
// hTheme - the theme data handle. if non-NULL, will return // hTheme - the theme data handle. if non-NULL, will return
// brush matching color from [SysMetrics] section of // brush matching color from [SysMetrics] section of
// theme. if NULL, will return the brush matching // theme. if NULL, will return the brush matching
// global system color. // global system color.
// //
// iColorId - the system color index defined in winuser.h // iColorId - the system color index defined in winuser.h
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI_(HBRUSH) GetThemeSysColorBrush(HTHEME hTheme, int iColorId); THEMEAPI_(HBRUSH)
GetThemeSysColorBrush(
HTHEME hTheme,
int iColorId
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// GetThemeSysBool() - Get the boolean value of specified System metric. // GetThemeSysBool() - Get the boolean value of specified System metric.
// //
// hTheme - the theme data handle. if non-NULL, will return // hTheme - the theme data handle. if non-NULL, will return
// BOOL from [SysMetrics] section of theme. // BOOL from [SysMetrics] section of theme.
// if NULL, will return the specified system boolean. // if NULL, will return the specified system boolean.
// //
// iBoolId - the TMT_XXX BOOL number (first BOOL // iBoolId - the TMT_XXX BOOL number (first BOOL
// is TMT_FLATMENUS) // is TMT_FLATMENUS)
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI_(BOOL) GetThemeSysBool(HTHEME hTheme, int iBoolId); THEMEAPI_(BOOL)
GetThemeSysBool(
HTHEME hTheme,
int iBoolId
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// GetThemeSysSize() - Get the value of the specified System size metric. // GetThemeSysSize() - Get the value of the specified System size metric.
// (scaled for the current logical screen dpi) // (scaled for the current logical screen dpi)
// //
// hTheme - the theme data handle. if non-NULL, will return // hTheme - the theme data handle. if non-NULL, will return
// size from [SysMetrics] section of theme. // size from [SysMetrics] section of theme.
// if NULL, will return the global system metric. // if NULL, will return the global system metric.
// //
// iSizeId - the following values are supported when // iSizeId - the following values are supported when
// hTheme is non-NULL: // hTheme is non-NULL:
// //
// SM_CXBORDER (border width) // SM_CXBORDER (border width)
// SM_CXVSCROLL (scrollbar width) // SM_CXVSCROLL (scrollbar width)
// SM_CYHSCROLL (scrollbar height) // SM_CYHSCROLL (scrollbar height)
// SM_CXSIZE (caption width) // SM_CXSIZE (caption width)
// SM_CYSIZE (caption height) // SM_CYSIZE (caption height)
// SM_CXSMSIZE (small caption width) // SM_CXSMSIZE (small caption width)
// SM_CYSMSIZE (small caption height) // SM_CYSMSIZE (small caption height)
// SM_CXMENUSIZE (menubar width) // SM_CXMENUSIZE (menubar width)
// SM_CYMENUSIZE (menubar height) // SM_CYMENUSIZE (menubar height)
// SM_CXPADDEDBORDER (padded border width)
// //
// when hTheme is NULL, iSizeId is passed directly // when hTheme is NULL, iSizeId is passed directly
// to the GetSystemMetrics() function // to the GetSystemMetrics() function
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI_(int) GetThemeSysSize(HTHEME hTheme, int iSizeId); THEMEAPI_(int)
GetThemeSysSize(
HTHEME hTheme,
int iSizeId
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// GetThemeSysFont() - Get the LOGFONT for the specified System font. // GetThemeSysFont() - Get the LOGFONT for the specified System font.
// //
// hTheme - the theme data handle. if non-NULL, will return // hTheme - the theme data handle. if non-NULL, will return
// font from [SysMetrics] section of theme. // font from [SysMetrics] section of theme.
// if NULL, will return the specified system font. // if NULL, will return the specified system font.
// //
// iFontId - the TMT_XXX font number (first font // iFontId - the TMT_XXX font number (first font
// is TMT_CAPTIONFONT) // is TMT_CAPTIONFONT)
// //
// plf - ptr to LOGFONT to receive the font value. // plf - ptr to LOGFONT to receive the font value.
// (scaled for the current logical screen dpi) // (scaled for the current logical screen dpi)
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI GetThemeSysFont(HTHEME hTheme, int iFontId, OUT LOGFONT *plf); THEMEAPI
GetThemeSysFont(
HTHEME hTheme,
int iFontId,
__out LOGFONTW *plf
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// GetThemeSysString() - Get the value of specified System string metric. // GetThemeSysString() - Get the value of specified System string metric.
// //
// hTheme - the theme data handle (required) // hTheme - the theme data handle (required)
// //
// iStringId - must be one of the following values: // iStringId - must be one of the following values:
// //
// TMT_CSSNAME // TMT_CSSNAME
// TMT_XMLNAME // TMT_XMLNAME
// //
// pszStringBuff - the buffer to receive the string value // pszStringBuff - the buffer to receive the string value
// //
// cchMaxStringChars - max. number of chars that pszStringBuff can hold // cchMaxStringChars - max. number of chars that pszStringBuff can hold
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI GetThemeSysString(HTHEME hTheme, int iStringId, THEMEAPI
OUT LPWSTR pszStringBuff, int cchMaxStringChars); GetThemeSysString(
HTHEME hTheme,
int iStringId,
__out_ecount(cchMaxStringChars) LPWSTR pszStringBuff,
int cchMaxStringChars
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// GetThemeSysInt() - Get the value of specified System int. // GetThemeSysInt() - Get the value of specified System int.
// //
// hTheme - the theme data handle (required) // hTheme - the theme data handle (required)
// //
// iIntId - must be one of the following values: // iIntId - must be one of the following values:
// //
// TMT_DPIX // TMT_DPIX
// TMT_DPIY // TMT_DPIY
// TMT_MINCOLORDEPTH // TMT_MINCOLORDEPTH
// //
// piValue - ptr to int to receive value // piValue - ptr to int to receive value
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI GetThemeSysInt(HTHEME hTheme, int iIntId, int *piValue); THEMEAPI
GetThemeSysInt(
HTHEME hTheme,
int iIntId,
__out int *piValue
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// IsThemeActive() - can be used to test if a system theme is active // IsThemeActive() - can be used to test if a system theme is active
// for the current user session. // for the current user session.
// //
// use the API "IsAppThemed()" to test if a theme is // use the API "IsAppThemed()" to test if a theme is
// active for the calling process. // active for the calling process.
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI_(BOOL) IsThemeActive(); THEMEAPI_(BOOL)
IsThemeActive(
VOID
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// IsAppThemed() - returns TRUE if a theme is active and available to // IsAppThemed() - returns TRUE if a theme is active and available to
// the current process // the current process
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI_(BOOL) IsAppThemed(); THEMEAPI_(BOOL)
IsAppThemed(
VOID
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// GetWindowTheme() - if window is themed, returns its most recent // GetWindowTheme() - if window is themed, returns its most recent
// HTHEME from OpenThemeData() - otherwise, returns // HTHEME from OpenThemeData() - otherwise, returns
// NULL. // NULL.
// //
// hwnd - the window to get the HTHEME of // hwnd - the window to get the HTHEME of
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI_(HTHEME) GetWindowTheme(HWND hwnd); THEMEAPI_(HTHEME)
GetWindowTheme(
HWND hwnd
);
#define ETDT_DISABLE 0x00000001
#define ETDT_ENABLE 0x00000002
#define ETDT_USETABTEXTURE 0x00000004
#define ETDT_USEAEROWIZARDTABTEXTURE 0x00000008
#define ETDT_ENABLETAB (ETDT_ENABLE | \
ETDT_USETABTEXTURE)
#define ETDT_ENABLEAEROWIZARDTAB (ETDT_ENABLE | \
ETDT_USEAEROWIZARDTABTEXTURE)
#define ETDT_VALIDBITS (ETDT_DISABLE | \
ETDT_ENABLE | \
ETDT_USETABTEXTURE | \
ETDT_USEAEROWIZARDTABTEXTURE)
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// EnableThemeDialogTexture() // EnableThemeDialogTexture()
// //
// - Enables/disables dialog background theme. This method can be used to // - Enables/disables dialog background theme. This method can be used to
// tailor dialog compatibility with child windows and controls that // tailor dialog compatibility with child windows and controls that
// may or may not coordinate the rendering of their client area backgrounds // may or may not coordinate the rendering of their client area backgrounds
// with that of their parent dialog in a manner that supports seamless // with that of their parent dialog in a manner that supports seamless
// background texturing. // background texturing.
// //
// hdlg - the window handle of the target dialog // hdlg - the window handle of the target dialog
// dwFlags - ETDT_ENABLE to enable the theme-defined dialog background texturing, // dwFlags - ETDT_ENABLE to enable the theme-defined dialog background texturing,
// ETDT_DISABLE to disable background texturing, // ETDT_DISABLE to disable background texturing,
// ETDT_ENABLETAB to enable the theme-defined background // ETDT_ENABLETAB to enable the theme-defined background
// texturing using the Tab texture // texturing using the Tab texture
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI
#define ETDT_DISABLE 0x00000001 EnableThemeDialogTexture(
#define ETDT_ENABLE 0x00000002 __in HWND hwnd,
#define ETDT_USETABTEXTURE 0x00000004 __in DWORD dwFlags
#define ETDT_ENABLETAB (ETDT_ENABLE | ETDT_USETABTEXTURE) );
THEMEAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// IsThemeDialogTextureEnabled() // IsThemeDialogTextureEnabled()
// //
// - Reports whether the dialog supports background texturing. // - Reports whether the dialog supports background texturing.
// //
// hdlg - the window handle of the target dialog // hdlg - the window handle of the target dialog
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI_(BOOL) IsThemeDialogTextureEnabled(HWND hwnd); THEMEAPI_(BOOL)
IsThemeDialogTextureEnabled(
__in HWND hwnd
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//---- flags to control theming within an app ---- //---- flags to control theming within an app ----
#define STAP_ALLOW_NONCLIENT (1 << 0) #define STAP_ALLOW_NONCLIENT (1UL << 0)
#define STAP_ALLOW_CONTROLS (1 << 1) #define STAP_ALLOW_CONTROLS (1UL << 1)
#define STAP_ALLOW_WEBCONTENT (1 << 2) #define STAP_ALLOW_WEBCONTENT (1UL << 2)
#define STAP_VALIDBITS (STAP_ALLOW_NONCLIENT | \
STAP_ALLOW_CONTROLS | \
STAP_ALLOW_WEBCONTENT)
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// GetThemeAppProperties() // GetThemeAppProperties()
// - returns the app property flags that control theming // - returns the app property flags that control theming
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI_(DWORD) GetThemeAppProperties(); THEMEAPI_(DWORD)
GetThemeAppProperties(
VOID
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// SetThemeAppProperties() // SetThemeAppProperties()
// - sets the flags that control theming within the app // - sets the flags that control theming within the app
// //
// dwFlags - the flag values to be set // dwFlags - the flag values to be set
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI_(void) SetThemeAppProperties(DWORD dwFlags); THEMEAPI_(void)
SetThemeAppProperties(
DWORD dwFlags
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// GetCurrentThemeName() // GetCurrentThemeName()
// - Get the name of the current theme in-use. // - Get the name of the current theme in-use.
// Optionally, return the ColorScheme name and the // Optionally, return the ColorScheme name and the
// Size name of the theme. // Size name of the theme.
// //
// pszThemeFileName - receives the theme path & filename // pszThemeFileName - receives the theme path & filename
// cchMaxNameChars - max chars allowed in pszNameBuff // cchMaxNameChars - max chars allowed in pszNameBuff
// //
// pszColorBuff - (optional) receives the canonical color scheme name // pszColorBuff - (optional) receives the canonical color scheme name
// (not the display name) // (not the display name)
// cchMaxColorChars - max chars allowed in pszColorBuff // cchMaxColorChars - max chars allowed in pszColorBuff
// //
// pszSizeBuff - (optional) receives the canonical size name // pszSizeBuff - (optional) receives the canonical size name
// (not the display name) // (not the display name)
// cchMaxSizeChars - max chars allowed in pszSizeBuff // cchMaxSizeChars - max chars allowed in pszSizeBuff
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI GetCurrentThemeName( THEMEAPI GetCurrentThemeName(
OUT LPWSTR pszThemeFileName, int cchMaxNameChars, __out_ecount(cchMaxNameChars) LPWSTR pszThemeFileName,
OUT OPTIONAL LPWSTR pszColorBuff, int cchMaxColorChars, int cchMaxNameChars,
OUT OPTIONAL LPWSTR pszSizeBuff, int cchMaxSizeChars); __out_ecount_opt(cchMaxColorChars) LPWSTR pszColorBuff,
int cchMaxColorChars,
__out_ecount_opt(cchMaxSizeChars) LPWSTR pszSizeBuff,
int cchMaxSizeChars
);
//--------------------------------------------------------------------------- #define SZ_THDOCPROP_DISPLAYNAME L"DisplayName"
// GetThemeDocumentationProperty() #define SZ_THDOCPROP_CANONICALNAME L"ThemeName"
// - Get the value for the specified property name from #define SZ_THDOCPROP_TOOLTIP L"ToolTip"
// the [documentation] section of the themes.ini file #define SZ_THDOCPROP_AUTHOR L"author"
// for the specified theme. If the property has been
// localized in the theme files string table, the
// localized version of the property value is returned.
//
// pszThemeFileName - filename of the theme file to query
// pszPropertyName - name of the string property to retreive a value for
// pszValueBuff - receives the property string value
// cchMaxValChars - max chars allowed in pszValueBuff
//---------------------------------------------------------------------------
#define SZ_THDOCPROP_DISPLAYNAME L"DisplayName"
#define SZ_THDOCPROP_CANONICALNAME L"ThemeName"
#define SZ_THDOCPROP_TOOLTIP L"ToolTip"
#define SZ_THDOCPROP_AUTHOR L"author"
THEMEAPI GetThemeDocumentationProperty(LPCWSTR pszThemeName, THEMEAPI
LPCWSTR pszPropertyName, OUT LPWSTR pszValueBuff, int cchMaxValChars); GetThemeDocumentationProperty(
LPCWSTR pszThemeName,
LPCWSTR pszPropertyName,
__out_ecount(cchMaxValChars) LPWSTR pszValueBuff,
int cchMaxValChars
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Theme API Error Handling // Theme API Error Handling
// //
// All functions in the Theme API not returning an HRESULT (THEMEAPI_) // All functions in the Theme API not returning an HRESULT (THEMEAPI_)
// use the WIN32 function "SetLastError()" to record any call failures. // use the WIN32 function "SetLastError()" to record any call failures.
// //
// To retreive the error code of the last failure on the // To retreive the error code of the last failure on the
// current thread for these type of API's, use the WIN32 function // current thread for these type of API's, use the WIN32 function
// "GetLastError()". // "GetLastError()".
skipping to change at line 857 skipping to change at line 1318
// strings using the Win32 API FormatMessage(). // strings using the Win32 API FormatMessage().
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// DrawThemeParentBackground() // DrawThemeParentBackground()
// - used by partially-transparent or alpha-blended // - used by partially-transparent or alpha-blended
// child controls to draw the part of their parent // child controls to draw the part of their parent
// that they appear in front of. // that they appear in front of.
// //
// hwnd - handle of the child control // hwnd - handle of the child control
//
// hdc - hdc of the child control // hdc - hdc of the child control
//
// prc - (optional) rect that defines the area to be
// drawn (CHILD coordinates)
//---------------------------------------------------------------------------
THEMEAPI
DrawThemeParentBackground(
HWND hwnd,
HDC hdc,
__in_opt const RECT* prc
);
#define DTPB_WINDOWDC 0x00000001
#define DTPB_USECTLCOLORSTATIC 0x00000002
#define DTPB_USEERASEBKGND 0x00000004
//---------------------------------------------------------------------------
// DrawThemeParentBackgroundEx()
// - used by partially-transparent or alpha-blended
// child controls to draw the part of their parent
// that they appear in front of.
// Sends a WM_ERASEBKGND message followed by a WM_PRINTCL
IENT.
//
// hwnd - handle of the child control
//
// hdc - hdc of the child control
//
// dwFlags - if 0, only returns S_OK if the parent handled
// WM_PRINTCLIENT.
// - if DTPB_WINDOWDC is set, hdc is assumed to be a window
DC,
// not a client DC.
// - if DTPB_USEERASEBKGND is set, the function will return
S_OK
// without sending a WM_CTLCOLORSTATIC message if the par
ent
// actually painted on WM_ERASEBKGND.
// - if DTPB_CTLCOLORSTATIC is set, the function will send
// a WM_CTLCOLORSTATIC message to the parent and use the
// brush if one is provided, else COLOR_BTNFACE.
//
// prc - (optional) rect that defines the area to be // prc - (optional) rect that defines the area to be
// drawn (CHILD coordinates) // drawn (CHILD coordinates)
//
// Return value - S_OK if something was painted, S_FALSE if not.
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, OPTIONAL RECT* prc); THEMEAPI
DrawThemeParentBackgroundEx(
HWND hwnd,
HDC hdc,
DWORD dwFlags,
__in_opt const RECT* prc
);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// EnableTheming() - enables or disables themeing for the current user // EnableTheming() - enables or disables themeing for the current user
// in the current and future sessions. // in the current and future sessions.
// //
// fEnable - if FALSE, disable theming & turn themes off. // fEnable - if FALSE, disable theming & turn themes off.
// - if TRUE, enable themeing and, if user previously // - if TRUE, enable themeing and, if user previously
// had a theme active, make it active now. // had a theme active, make it active now.
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
THEMEAPI EnableTheming(BOOL fEnable); THEMEAPI
EnableTheming(
BOOL fEnable
);
#define GBF_DIRECT 0x00000001 // direct dereferencing.
#define GBF_COPY 0x00000002 // create a copy of the bitmap
#define GBF_VALIDBITS (GBF_DIRECT | \
GBF_COPY)
#if (_WIN32_WINNT >= 0x0600)
THEMEAPI
GetThemeBitmap(
HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId,
ULONG dwFlags,
__out HBITMAP* phBitmap
);
//-----------------------------------------------------------------------
// GetThemeStream() - Get the value for the specified STREAM property
//
// hTheme - theme data handle
// iPartId - part number
// iStateId - state number of part
// iPropId - the property number to get the value for
// ppvStream - if non-null receives the value of the STREAM property (not
to be freed)
// pcbStream - if non-null receives the size of the STREAM property
// hInst - NULL when iPropId==TMT_STREAM, HINSTANCE of a loaded mssty
les
// file when iPropId==TMT_DISKSTREAM (use GetCurrentThemeName
// and LoadLibraryEx(LOAD_LIBRARY_AS_DATAFILE)
//-----------------------------------------------------------------------
THEMEAPI
GetThemeStream(
HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId,
__out VOID **ppvStream,
__out_opt DWORD *pcbStream,
__in_opt HINSTANCE hInst
);
#endif // #if (_WIN32_WINNT >= 0x0600)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
//---- bits used in dwFlags of DTBGOPTS ---- // BufferedPaintInit() - Initialize the Buffered Paint API.
#define DTBG_CLIPRECT 0x00000001 // rcClip has been specified // Should be called prior to BeginBufferedPaint,
#define DTBG_DRAWSOLID 0x00000002 // draw transparent/alpha images as so // and should have a matching BufferedPaintUnInit.
lid //------------------------------------------------------------------------
#define DTBG_OMITBORDER 0x00000004 // don't draw border of part THEMEAPI
#define DTBG_OMITCONTENT 0x00000008 // don't draw content area of part BufferedPaintInit(
VOID
);
#define DTBG_COMPUTINGREGION 0x00000010 // TRUE if calling to compute region //------------------------------------------------------------------------
// BufferedPaintUnInit() - Uninitialize the Buffered Paint API.
// Should be called once for each call to BufferedPaint
Init,
// when calls to BeginBufferedPaint are no longer neede
d.
//------------------------------------------------------------------------
THEMEAPI
BufferedPaintUnInit(
VOID
);
#define DTBG_MIRRORDC 0x00000020 // assume the hdc is mirrorred and
// flip images as appropriate (current
ly
// only supported for bgtype=imagefile
)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
typedef struct _DTBGOPTS // BeginBufferedPaint() - Begins a buffered paint operation.
//
// hdcTarget - Target DC on which the buffer will be painted
// rcTarget - Rectangle specifying the area of the target DC to pai
nt to
// dwFormat - Format of the buffer (see BP_BUFFERFORMAT)
// pPaintParams - Paint operation parameters (see BP_PAINTPARAMS)
// phBufferedPaint - Pointer to receive handle to new buffered paint conte
xt
//------------------------------------------------------------------------
// HPAINTBUFFER
typedef HANDLE HPAINTBUFFER; // handle to a buffered paint context
// BP_BUFFERFORMAT
typedef enum _BP_BUFFERFORMAT
{ {
DWORD dwSize; // size of the struct BPBF_COMPATIBLEBITMAP, // Compatible bitmap
DWORD dwFlags; // which options have been specified BPBF_DIB, // Device-independent bitmap
RECT rcClip; // clipping rectangle BPBF_TOPDOWNDIB, // Top-down device-independent bitmap
} BPBF_TOPDOWNMONODIB // Top-down monochrome device-independent bitmap
DTBGOPTS, *PDTBGOPTS; } BP_BUFFERFORMAT;
#define BPBF_COMPOSITED BPBF_TOPDOWNDIB
// BP_ANIMATIONSTYLE
typedef enum _BP_ANIMATIONSTYLE
{
BPAS_NONE, // No animation
BPAS_LINEAR, // Linear fade animation
BPAS_CUBIC, // Cubic fade animation
BPAS_SINE // Sinusoid fade animation
} BP_ANIMATIONSTYLE;
// BP_ANIMATIONPARAMS
typedef struct _BP_ANIMATIONPARAMS
{
DWORD cbSize;
DWORD dwFlags; // BPAF_ flags
BP_ANIMATIONSTYLE style;
DWORD dwDuration;
} BP_ANIMATIONPARAMS, *PBP_ANIMATIONPARAMS;
#define BPPF_ERASE 0x0001 // Empty the buffer during BeginBuffered
Paint()
#define BPPF_NOCLIP 0x0002 // Don't apply the target DC's clip regi
on to the double buffer
#define BPPF_NONCLIENT 0x0004 // Using a non-client DC
// BP_PAINTPARAMS
typedef struct _BP_PAINTPARAMS
{
DWORD cbSize;
DWORD dwFlags; // BPPF_ flags
const RECT * prcExclude;
const BLENDFUNCTION * pBlendFunction;
} BP_PAINTPARAMS, *PBP_PAINTPARAMS;
THEMEAPI_(HPAINTBUFFER)
BeginBufferedPaint(
HDC hdcTarget,
const RECT* prcTarget,
BP_BUFFERFORMAT dwFormat,
__in_opt BP_PAINTPARAMS *pPaintParams,
__out HDC *phdc
);
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// DrawThemeBackgroundEx() // EndBufferedPaint() - Ends a buffered paint operation.
// - draws the theme-specified border and fill for //
// the "iPartId" and "iStateId". This could be // hBufferedPaint - handle to buffered paint context
// based on a bitmap file, a border and fill, or // fUpdateTarget - update target DC
// other image description. NOTE: This will be //------------------------------------------------------------------------
// merged back into DrawThemeBackground() after THEMEAPI
// BETA 2. EndBufferedPaint(
HPAINTBUFFER hBufferedPaint,
BOOL fUpdateTarget
);
//------------------------------------------------------------------------
// GetBufferedPaintTargetRect() - Returns the target rectangle specified during
BeginBufferedPaint
//
// hBufferedPaint - handle to buffered paint context
// prc - pointer to receive target rectangle
//------------------------------------------------------------------------
THEMEAPI
GetBufferedPaintTargetRect(
HPAINTBUFFER hBufferedPaint,
__out RECT *prc
);
//------------------------------------------------------------------------
// GetBufferedPaintTargetDC() - Returns the target DC specified during BeginBuf
feredPaint
//
// hBufferedPaint - handle to buffered paint context
//------------------------------------------------------------------------
THEMEAPI_(HDC)
GetBufferedPaintTargetDC(
HPAINTBUFFER hBufferedPaint
);
//------------------------------------------------------------------------
// GetBufferedPaintDC() - Returns the same paint DC returned by BeginBufferedPa
int
//
// hBufferedPaint - handle to buffered paint context
//------------------------------------------------------------------------
THEMEAPI_(HDC)
GetBufferedPaintDC(
HPAINTBUFFER hBufferedPaint
);
//------------------------------------------------------------------------
// GetBufferedPaintBits() - Obtains a pointer to the buffer bitmap, if the buff
er is a DIB
//
// hBufferedPaint - handle to buffered paint context
// ppbBuffer - pointer to receive pointer to buffer bitmap pixels
// pcxRow - pointer to receive width of buffer bitmap, in pixel
s;
// this value may not necessarily be equal to the buff
er width
//------------------------------------------------------------------------
THEMEAPI
GetBufferedPaintBits(
HPAINTBUFFER hBufferedPaint,
__out RGBQUAD **ppbBuffer,
__out int *pcxRow
);
//------------------------------------------------------------------------
// BufferedPaintClear() - Clears given rectangle to ARGB = {0, 0, 0, 0}
//
// hBufferedPaint - handle to buffered paint context
// prc - rectangle to clear; NULL specifies entire buffer
//------------------------------------------------------------------------
THEMEAPI
BufferedPaintClear(
HPAINTBUFFER hBufferedPaint,
__in_opt const RECT *prc
);
//------------------------------------------------------------------------
// BufferedPaintSetAlpha() - Set alpha to given value in given rectangle
//
// hBufferedPaint - handle to buffered paint context
// prc - rectangle to set alpha in; NULL specifies entire b
uffer
// alpha - alpha value to set in the given rectangle
//------------------------------------------------------------------------
THEMEAPI
BufferedPaintSetAlpha(
HPAINTBUFFER hBufferedPaint,
__in_opt const RECT *prc,
BYTE alpha
);
// Macro for setting the buffer to opaque (alpha = 255)
#define BufferedPaintMakeOpaque(hBufferedPaint, prc) BufferedPaintSetAlpha(hBuff
eredPaint, prc, 255)
//------------------------------------------------------------------------
// BufferedPaintStopAllAnimations() - Stop all buffer animations for the given
window
//
// hwnd - window on which to stop all animations
//------------------------------------------------------------------------
THEMEAPI
BufferedPaintStopAllAnimations(
HWND hwnd
);
typedef HANDLE HANIMATIONBUFFER; // handle to a buffered paint animation
THEMEAPI_(HANIMATIONBUFFER)
BeginBufferedAnimation(
HWND hwnd,
HDC hdcTarget,
const RECT* prcTarget,
BP_BUFFERFORMAT dwFormat,
__in_opt BP_PAINTPARAMS *pPaintParams,
__in BP_ANIMATIONPARAMS *pAnimationParams,
__out HDC *phdcFrom,
__out HDC *phdcTo
);
THEMEAPI
EndBufferedAnimation(
HANIMATIONBUFFER hbpAnimation,
BOOL fUpdateTarget
);
THEMEAPI_(BOOL)
BufferedPaintRenderAnimation(
HWND hwnd,
HDC hdcTarget
);
//----------------------------------------------------------------------------
// Tells if the DWM is running, and composition effects are possible for this
// process (themes are active).
// Roughly equivalent to "DwmIsCompositionEnabled() && IsAppthemed()"
//----------------------------------------------------------------------------
THEMEAPI_(BOOL) IsCompositionActive();
//------------------------------------------------------------------------
// GetThemeTransitionDuration()
// - Gets the duration for the specified transition
// //
// hTheme - theme data handle // hTheme - theme data handle
// hdc - HDC to draw into // iPartId - part number
// iPartId - part number to draw // iStateIdFrom - starting state number of part
// iStateId - state number (of the part) to draw // iStateIdTo - ending state number of part
// pRect - defines the size/location of the part // iPropId - property id
// pOptions - ptr to optional params // pdwDuration - receives the transition duration
//------------------------------------------------------------------------ //------------------------------------------------------------------------
THEMEAPI DrawThemeBackgroundEx(HTHEME hTheme, HDC hdc, THEMEAPI
int iPartId, int iStateId, const RECT *pRect, OPTIONAL const DTBGOPTS *pOpti GetThemeTransitionDuration(
ons); HTHEME hTheme,
int iPartId,
int iStateIdFrom,
int iStateIdTo,
int iPropId,
__out DWORD *pdwDuration
);
//--------------------------------------------------------------------------- #endif /* _UXTHEME_H_ */
//#endif /* (_WIN32_WINNT >= 0x0500) *//
//---------------------------------------------------------------------------
#endif // _UXTHEME_H_
//---------------------------------------------------------------------------
 End of changes. 85 change blocks. 
212 lines changed or deleted 995 lines changed or added

This html diff was produced by rfcdiff 1.41.