mCtrl  0.11.1
theme.h File Reference

Go to the source code of this file.

Detailed Description

Theme wrapper functions.

This miscellaneous module provides wrapper of functions exported from UXTHEME.DLL, as the library is only available on Windows XP and later.

The wrappers deal with situation when the UXTHEME.DLL is not available (e.g. on Windows 2000), when themes are disabled (then mcOpenThemeData() and al. return NULL) and so on.

The wrapper functions provided by this module simply have the same name as functions exported from UXTHEME.DLL, with the prefix mc prepended. Each wrapper simply calls its counterpart in UXTHEME.DLL if it is loaded and available (as some UXTHEME.DLL functions were introduced later then on Windows XP).

Before using anu functions from this modules, application has 1st to initialize it with mcTheme_Initialize(). The functions attempts to load UXTHEME.DLL if available and performs needed initialization.

If the UXTHEME.DLL is not used, or if the particular function is not available, then most of the wrapper functions just fail gracefully and return E_NOTIMPL, NULL, 0 or FALSE, depending on the return type.

However there are also wrapper functions which provide some reasonable fallback implementation. Those cases are described in description of particular functions, and also see sections below.

Note
Note that future versions of mCtrl can provide fallback implementation for more functions. If you want directly call the UXTHEME.DLL function, then get its address manually with GetProcAddress() and do not rely on mCtrl wrapper functions.

Themed Painting

Majority of UXTHEME.DLL API focuses on themed painting (all those functions working with HTHEME handle).

If UXTHEME.DLL is not available, or if application uses COMCTL32.DLL version 5.x or older, all the wrappers falling into this category behave as if no theming is available.

This in particular means the following:

System Theme Properties

All the wrapper functions for getting system theme properties, i.e. all the functions mcGetThemeSys...(), implement a reasonable fallback, calling SystemParametersInfo(), GetSysColor() and so on.

The only notable exception is mcGetThemeSysInt() which has no pre-theme counterpart (as far as authors of mCtrl are aware).

section sec_theme_buffered_paint Buffered Painting.

All the functions for double-buffering, i.e. mcBufferedPaintInit(), mcBufferedPaintUnInit(), mcBeginBufferedPaint() and mcEndBufferedPaint(), implement a fallback in case UXTHEME.DLL is not available.

All those fallbacks are good enough for implementing simple double-buffered painting. This limitations for example means the paramaters like dwFormat or pPaintParams of mcBeginBufferedPaint() are simply ignored.

(However note that nothing more is provided by the fallback. In particular, mcBufferedPaintClear() and mcBufferedPaintSetAlpha() just fail.)

This allows application to implement a double-buffered painting regardless whether UXTHEME.DLL is present or not.

Initialization Functions

BOOL mcTheme_Initialize (void)
 
void mcTheme_Terminate (void)
 

Wrapper Functions

HANIMATIONBUFFER mcBeginBufferedAnimation (HWND hwnd, HDC hdcTarget, const RECT *rcTarget, BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS *pPaintParams, BP_ANIMATIONPARAMS *pAnimationParams, HDC *phdcFrom, HDC *phdcTo)
 
HPAINTBUFFER mcBeginBufferedPaint (HDC hdcTarget, const RECT *prcTarget, BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS *pPaintParams, HDC *phdc)
 
BOOL mcBeginPanningFeedback (HWND hwnd)
 
HRESULT mcBufferedPaintClear (HPAINTBUFFER hBufferedPaint, const RECT *prc)
 
HRESULT mcBufferedPaintInit (void)
 
BOOL mcBufferedPaintRenderAnimation (HWND hwnd, HDC hdcTarget)
 
HRESULT mcBufferedPaintSetAlpha (HPAINTBUFFER hBufferedPaint, const RECT *prc, BYTE alpha)
 
HRESULT mcBufferedPaintStopAllAnimations (HWND hwnd)
 
HRESULT mcBufferedPaintUnInit (void)
 
HRESULT mcCloseThemeData (HTHEME hTheme)
 
HRESULT mcDrawThemeBackground (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prc, const RECT *prcClip)
 
HRESULT mcDrawThemeBackgroundEx (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prc, const DTBGOPTS *pOptions)
 
HRESULT mcDrawThemeEdge (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prcDest, UINT uEdge, UINT uFlags, RECT *prcContent)
 
HRESULT mcDrawThemeIcon (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prc, HIMAGELIST himl, int iImageIndex)
 
HRESULT mcDrawThemeParentBackground (HWND hwnd, HDC hdc, RECT *prc)
 
HRESULT mcDrawThemeParentBackgroundEx (HWND hwnd, HDC hdc, DWORD dwFlags, RECT *prc)
 
HRESULT mcDrawThemeText (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const WCHAR *pszText, int iCharCount, DWORD dwFlags, DWORD dwFlags2, const RECT *prc)
 
HRESULT mcDrawThemeTextEx (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const WCHAR *pszText, int iCharCount, DWORD dwFlags, RECT *prc, const DTTOPTS *pOptions)
 
HRESULT mcEnableThemeDialogTexture (HWND hwnd, DWORD dwFlags)
 
HRESULT mcEndBufferedAnimation (HANIMATIONBUFFER hbpAnimation, BOOL fUpdateTarget)
 
HRESULT mcEndBufferedPaint (HPAINTBUFFER hBufferedPaint, BOOL fUpdateTarget)
 
BOOL mcEndPanningFeedback (HWND hwnd, BOOL fAnimateBack)
 
HRESULT mcGetBufferedPaintBits (HPAINTBUFFER hBufferedPaint, RGBQUAD **ppbBuffer, int *pcxRow)
 
HDC mcGetBufferedPaintDC (HPAINTBUFFER hBufferedPaint)
 
HDC mcGetBufferedPaintTargetDC (HPAINTBUFFER hBufferedPaint)
 
HRESULT mcGetBufferedPaintTargetRect (HPAINTBUFFER hBufferedPaint, RECT *prc)
 
HRESULT mcGetCurrentThemeName (WCHAR *pszThemeFilename, int cchMaxFilenameChars, WCHAR *pszColorBuff, int cchMaxColorChars, WCHAR *pszSizeBuff, int cchMaxSizeChars)
 
DWORD mcGetThemeAppProperties (void)
 
HRESULT mcGetThemeBackgroundContentRect (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prcBounding, RECT *prcContent)
 
HRESULT mcGetThemeBackgroundExtent (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prcContent, RECT *prcExtent)
 
HRESULT mcGetThemeBackgroundRegion (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prc, HRGN *phRegion)
 
HRESULT mcGetThemeBitmap (HTHEME hTheme, int iPartId, int iStateId, int iPropId, ULONG uFlags, HBITMAP *phBitmap)
 
HRESULT mcGetThemeBool (HTHEME hTheme, int iPartId, int iStateId, int iPropId, BOOL *pfValue)
 
HRESULT mcGetThemeColor (HTHEME hTheme, int iPartId, int iStateId, int iPropId, COLORREF *pColor)
 
HRESULT mcGetThemeDocumentationProperty (const WCHAR *pszThemeName, const WCHAR *pszPropName, WCHAR *pszValueBuf, int cchMaxValChars)
 
HRESULT mcGetThemeEnumValue (HTHEME hTheme, int iPartId, int iStateId, int iPropId, int *piValue)
 
HRESULT mcGetThemeFilename (HTHEME hTheme, int iPartId, int iStateId, int iPropId, WCHAR *pszThemeFilename, int cchMaxBuffChars)
 
HRESULT mcGetThemeFont (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, LOGFONTW *pLogFont)
 
HRESULT mcGetThemeInt (HTHEME hTheme, int iPartId, int iStateId, int iPropId, int *piValue)
 
HRESULT mcGetThemeIntList (HTHEME hTheme, int iPartId, int iStateId, int iPropId, INTLIST *pIntList)
 
HRESULT mcGetThemeMargins (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, RECT *prc, MARGINS *pMargins)
 
HRESULT mcGetThemeMetric (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, int *piValue)
 
HRESULT mcGetThemePartSize (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prc, enum THEMESIZE eSize, SIZE *psz)
 
HRESULT mcGetThemePosition (HTHEME hTheme, int iPartId, int iStateId, int iPropId, POINT *pPoint)
 
HRESULT mcGetThemePropertyOrigin (HTHEME hTheme, int iPartId, int iStateId, int iPropId, enum PROPERTYORIGIN *pOrigin)
 
HRESULT mcGetThemeRect (HTHEME hTheme, int iPartId, int iStateId, int iPropId, RECT *prc)
 
HRESULT mcGetThemeStream (HTHEME hTheme, int iPartId, int iStateId, int iPropId, void **ppvStream, DWORD *pcbStream, HINSTANCE hInst)
 
HRESULT mcGetThemeString (HTHEME hTheme, int iPartId, int iStateId, int iPropId, WCHAR *pszBuff, int cchMaxBuffChars)
 
BOOL mcGetThemeSysBool (HTHEME hTheme, int iBoolId)
 
COLORREF mcGetThemeSysColor (HTHEME hTheme, int iColorId)
 
HBRUSH mcGetThemeSysColorBrush (HTHEME hTheme, int iColorId)
 
HRESULT mcGetThemeSysFont (HTHEME hTheme, int iFontId, LOGFONTW *pLogFont)
 
HRESULT mcGetThemeSysInt (HTHEME hTheme, int iIntId, int *piValue)
 
int mcGetThemeSysSize (HTHEME hTheme, int iSizeId)
 
HRESULT mcGetThemeSysString (HTHEME hTheme, int iStringId, WCHAR *pszBuff, int cchMaxBuffChars)
 
HRESULT mcGetThemeTextExtent (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const WCHAR *pszText, int cchTextMax, DWORD dwFlags, const RECT *prcBounding, RECT *prcExtent)
 
HRESULT mcGetThemeTextMetrics (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, TEXTMETRIC *pTextMetric)
 
HRESULT mcGetThemeTransitionDuration (HTHEME hTheme, int iPartId, int iStateIdFrom, int iStateIdTo, int iPropId, DWORD *pdwDuration)
 
HTHEME mcGetWindowTheme (HWND hwnd)
 
HRESULT mcHitTestThemeBackground (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, DWORD dwOptions, const RECT *prc, HRGN hrgn, POINT ptTest, WORD *pwHitTestCode)
 
BOOL mcIsAppThemed (void)
 
BOOL mcIsCompositionActive (void)
 
BOOL mcIsThemeActive (void)
 
BOOL mcIsThemeBackgroundPartiallyTransparent (HTHEME hTheme, int iPartId, int iStateId)
 
BOOL mcIsThemeDialogTextureEnabled (HWND hwnd)
 
BOOL mcIsThemePartDefined (HTHEME hTheme, int iPartId, int iStateId)
 
HTHEME mcOpenThemeData (HWND hwnd, const WCHAR *pszClassList)
 
HTHEME mcOpenThemeDataEx (HWND hwnd, const WCHAR *pszClassList, DWORD dwFlags)
 
void mcSetThemeAppProperties (DWORD dwFlags)
 
HRESULT mcSetWindowTheme (HWND hwnd, const WCHAR *pszSubAppName, const WCHAR *pszSubIdList)
 
HRESULT mcSetWindowThemeAttribute (HWND hwnd, enum WINDOWTHEMEATTRIBUTETYPE eAttribute, void *pvAttribute, DWORD cbAttribute)
 
BOOL mcUpdatePanningFeedback (HWND hwnd, LONG lTotalOverpanOffsetX, LONG lTotalOverpanOffsetY, BOOL fInInertia)
 

Function Documentation

BOOL mcTheme_Initialize ( void  )

Initializes the module. This function must be called before any other function of this module is used.

Note that the function checks version of Windows and version of COMCTL32.DLL. It only loads UXTHEME.DLL and gets

Returns
TRUE on success, FALSE on failure.
void mcTheme_Terminate ( void  )

Uninitialization. If mcTheme_Initialize() loaded UXTHEME.DLL, is is unloaded with FreeLibrary() and releases any related resources.

HANIMATIONBUFFER mcBeginBufferedAnimation ( HWND  hwnd,
HDC  hdcTarget,
const RECT *  rcTarget,
BP_BUFFERFORMAT  dwFormat,
BP_PAINTPARAMS *  pPaintParams,
BP_ANIMATIONPARAMS *  pAnimationParams,
HDC *  phdcFrom,
HDC *  phdcTo 
)

Calls BeginBufferedAnimation() if available (and UXTHEME.DLL is in use), or returns NULL.

Parameters
hwnd
hdcTarget
rcTarget
dwFormat
pPaintParams
pAnimationParams
phdcFrom
phdcTo
Returns
Return value of BeginBufferedAnimation() or NULL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HPAINTBUFFER mcBeginBufferedPaint ( HDC  hdcTarget,
const RECT *  prcTarget,
BP_BUFFERFORMAT  dwFormat,
BP_PAINTPARAMS *  pPaintParams,
HDC *  phdc 
)

Calls BeginBufferedPaint() if available (and UXTHEME.DLL is in use), or emulates it if it does not.

Parameters
hdcTarget
prcTarget
dwFormat
pPaintParams
phdc
Returns
Return value of BeginBufferedPaint() or NULL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
BOOL mcBeginPanningFeedback ( HWND  hwnd)

Calls BeginPanningFeedback() if available (and UXTHEME.DLL is in use), or returns FALSE.

Parameters
hwnd
Returns
Return value of BeginPanningFeedback() or FALSE.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HRESULT mcBufferedPaintClear ( HPAINTBUFFER  hBufferedPaint,
const RECT *  prc 
)

Calls BufferedPaintClear() if available (and UXTHEME.DLL is in use), orreturns E_NOTIMPL.

Parameters
hBufferedPaint
prc
Returns
Return value of BufferedPaintClear() or E_NOTIMPL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HRESULT mcBufferedPaintInit ( void  )

Calls BufferedPaintInit() if available (and UXTHEME.DLL is in use), or emulates it if it does not.

Returns
Return value of BufferedPaintInit() or E_NOTIMPL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
BOOL mcBufferedPaintRenderAnimation ( HWND  hwnd,
HDC  hdcTarget 
)

Calls BufferedPaintRenderAnimation() if available (and UXTHEME.DLL is in use), or returns FALSE.

Parameters
hwnd
hdcTarget
Returns
Return value of mcBufferedPaintRenderAnimation() or FALSE.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HRESULT mcBufferedPaintSetAlpha ( HPAINTBUFFER  hBufferedPaint,
const RECT *  prc,
BYTE  alpha 
)

Calls BufferedPaintSetAlpha() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hBufferedPaint
prc
alpha
Returns
Return value of BufferedPaintSetAlpha() or E_NOTIMPL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HRESULT mcBufferedPaintStopAllAnimations ( HWND  hwnd)

Calls BufferedPaintStopAllAnimations() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hwnd
Returns
Return value of BufferedPaintStopAllAnimations() or E_NOTIMPL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HRESULT mcBufferedPaintUnInit ( void  )

Calls BufferedPaintUnInit() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Returns
Return value of BufferedPaintUnInit() or E_NOTIMPL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HRESULT mcCloseThemeData ( HTHEME  hTheme)

Calls CloseThemeData() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
Returns
Return value of CloseThemeData() or E_NOTIMPL.
HRESULT mcDrawThemeBackground ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
const RECT *  prc,
const RECT *  prcClip 
)

Calls DrawThemeBackground() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
prc
prcClip
Returns
Return value of DrawThemeBackground() or E_NOTIMPL.
HRESULT mcDrawThemeBackgroundEx ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
const RECT *  prc,
const DTBGOPTS *  pOptions 
)

Calls DrawThemeBackgroundEx() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
prc
pOptions
Returns
Return value of DrawThemeBackgroundEx() or E_NOTIMPL.
HRESULT mcDrawThemeEdge ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
const RECT *  prcDest,
UINT  uEdge,
UINT  uFlags,
RECT *  prcContent 
)

Calls DrawThemeEdge() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
prcDest
uEdge
uFlags
prcContent
Returns
Return value of DrawThemeEdge() or E_NOTIMPL.
HRESULT mcDrawThemeIcon ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
const RECT *  prc,
HIMAGELIST  himl,
int  iImageIndex 
)

Calls DrawThemeIcon() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
prc
himl
iImageIndex
Returns
Return value of DrawThemeIcon() or E_NOTIMPL.
HRESULT mcDrawThemeParentBackground ( HWND  hwnd,
HDC  hdc,
RECT *  prc 
)

Calls DrawThemeParentBackground() if available (and UXTHEME.DLL is in use).

If it is not, the function fallbacks to asking the parent to paint itself by sending WM_ERASEBKGND and WM_PRINTCLIENT.

Parameters
hwnd
hdc
prc
Returns
Return value of DrawThemeParentBackground() or S_OK.
HRESULT mcDrawThemeParentBackgroundEx ( HWND  hwnd,
HDC  hdc,
DWORD  dwFlags,
RECT *  prc 
)

Calls DrawThemeParentBackgroundEx() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hwnd
hdc
dwFlags
prc
Returns
Return value of DrawThemeParentBackgroundEx() or E_NOTIMPL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HRESULT mcDrawThemeText ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
const WCHAR *  pszText,
int  iCharCount,
DWORD  dwFlags,
DWORD  dwFlags2,
const RECT *  prc 
)

Calls DrawThemeText() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
pszText
iCharCount
dwFlags
dwFlags2
prc
Returns
Return value of DrawThemeText() or E_NOTIMPL.
HRESULT mcDrawThemeTextEx ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
const WCHAR *  pszText,
int  iCharCount,
DWORD  dwFlags,
RECT *  prc,
const DTTOPTS *  pOptions 
)

Calls DrawThemeTextEx() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
pszText
iCharCount
dwFlags
prc
pOptions
Returns
Return value of DrawThemeTextEx() or E_NOTIMPL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HRESULT mcEnableThemeDialogTexture ( HWND  hwnd,
DWORD  dwFlags 
)

Calls EnableThemeDialogTexture() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hwnd
dwFlags
Returns
Return value of EnableThemeDialogTexture() or E_NOTIMPL.
HRESULT mcEndBufferedAnimation ( HANIMATIONBUFFER  hbpAnimation,
BOOL  fUpdateTarget 
)

Calls EndBufferedAnimation() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hbpAnimation
fUpdateTarget
Returns
Return value of EndBufferedAnimation() or E_NOTIMPL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HRESULT mcEndBufferedPaint ( HPAINTBUFFER  hBufferedPaint,
BOOL  fUpdateTarget 
)

Calls EndBufferedPaint() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hBufferedPaint
fUpdateTarget
Returns
Return value of EndBufferedPaint() or E_NOTIMPL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
BOOL mcEndPanningFeedback ( HWND  hwnd,
BOOL  fAnimateBack 
)

Calls EndPanningFeedback() if available (and UXTHEME.DLL is in use), or returns FALSE.

Parameters
hwnd
fAnimateBack
Returns
Return value of EndPanningFeedback() or FALSE.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HRESULT mcGetBufferedPaintBits ( HPAINTBUFFER  hBufferedPaint,
RGBQUAD **  ppbBuffer,
int *  pcxRow 
)

Calls GetBufferedPaintBits() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hBufferedPaint
ppbBuffer
pcxRow
Returns
Return value of GetBufferedPaintBits() or E_NOTIMPL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HDC mcGetBufferedPaintDC ( HPAINTBUFFER  hBufferedPaint)

Calls GetBufferedPaintDC() if available (and UXTHEME.DLL is in use), or returns NULL.

Parameters
hBufferedPaint
Returns
Return value of GetBufferedPaintDC() or NULL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HDC mcGetBufferedPaintTargetDC ( HPAINTBUFFER  hBufferedPaint)

Calls GetBufferedPaintTargetDC() if available (and UXTHEME.DLL is in use), or returns NULL.

Parameters
hBufferedPaint
Returns
Return value of GetBufferedPaintTargetDC() or NULL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HRESULT mcGetBufferedPaintTargetRect ( HPAINTBUFFER  hBufferedPaint,
RECT *  prc 
)

Calls GetBufferedPaintTargetRect() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hBufferedPaint
prc
Returns
Return value of GetBufferedPaintTargetRect() or E_NOTIMPL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HRESULT mcGetCurrentThemeName ( WCHAR *  pszThemeFilename,
int  cchMaxFilenameChars,
WCHAR *  pszColorBuff,
int  cchMaxColorChars,
WCHAR *  pszSizeBuff,
int  cchMaxSizeChars 
)

Calls GetCurrentThemeName() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
pszThemeFilename
cchMaxFilenameChars
pszColorBuff
cchMaxColorChars
pszSizeBuff
cchMaxSizeChars
Returns
Return value of GetCurrentThemeName() or E_NOTIMPL.
DWORD mcGetThemeAppProperties ( void  )

Calls GetThemeAppProperties() if available (and UXTHEME.DLL is in use), or returns NULL.

Returns
Return value of GetThemeAppProperties() or 0.
HRESULT mcGetThemeBackgroundContentRect ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
const RECT *  prcBounding,
RECT *  prcContent 
)

Calls GetThemeBackgroundContentRect() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
prcBounding
prcContent
Returns
Return value of GetThemeBackgroundContentRect() or E_NOTIMPL.
HRESULT mcGetThemeBackgroundExtent ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
const RECT *  prcContent,
RECT *  prcExtent 
)

Calls GetThemeBackgroundExtent() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
prcContent
prcExtent
Returns
Return value of GetThemeBackgroundExtent() or E_NOTIMPL.
HRESULT mcGetThemeBackgroundRegion ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
const RECT *  prc,
HRGN *  phRegion 
)

Calls GetThemeBackgroundRegion() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
prc
phRegion
Returns
Return value of GetThemeBackgroundRegion() or E_NOTIMPL.
HRESULT mcGetThemeBitmap ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
ULONG  uFlags,
HBITMAP *  phBitmap 
)

Calls GetThemeBitmap() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iPartId
iStateId
iPropId
uFlags
phBitmap
Returns
Return value of GetThemeBitmap() or E_NOTIMPL.
HRESULT mcGetThemeBool ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
BOOL *  pfValue 
)

Calls GetThemeBool() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iPartId
iStateId
iPropId
pfValue
Returns
Return value of GetThemeBool() or E_NOTIMPL.
HRESULT mcGetThemeColor ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
COLORREF *  pColor 
)

Calls GetThemeColor() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iPartId
iStateId
iPropId
pColor
Returns
Return value of GetThemeColor() or E_NOTIMPL.
HRESULT mcGetThemeDocumentationProperty ( const WCHAR *  pszThemeName,
const WCHAR *  pszPropName,
WCHAR *  pszValueBuf,
int  cchMaxValChars 
)

Calls GetThemeDocumentationProperty() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
pszThemeName
pszPropName
pszValueBuf
cchMaxValChars
Returns
Return value of GetThemeDocumentationProperty() or E_NOTIMPL.
HRESULT mcGetThemeEnumValue ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
int *  piValue 
)

Calls GetThemeEnumValue() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iPartId
iStateId
iPropId
piValue
Returns
Return value of GetThemeEnumValue() or E_NOTIMPL.
HRESULT mcGetThemeFilename ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
WCHAR *  pszThemeFilename,
int  cchMaxBuffChars 
)

Calls GetThemeFilename() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iPartId
iStateId
iPropId
pszThemeFilename
cchMaxBuffChars
Returns
Return value of GetThemeFilename() or E_NOTIMPL.
HRESULT mcGetThemeFont ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
int  iPropId,
LOGFONTW *  pLogFont 
)

Calls GetThemeFont() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
iPropId
pLogFont
Returns
Return value of GetThemeFont() or E_NOTIMPL.
HRESULT mcGetThemeInt ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
int *  piValue 
)

Calls GetThemeInt() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iPartId
iStateId
iPropId
piValue
Returns
Return value of GetThemeInt() or E_NOTIMPL.
HRESULT mcGetThemeIntList ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
INTLIST *  pIntList 
)

Calls GetThemeIntList() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iPartId
iStateId
iPropId
pIntList
Returns
Return value of GetThemeIntList() or E_NOTIMPL.
HRESULT mcGetThemeMargins ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
int  iPropId,
RECT *  prc,
MARGINS *  pMargins 
)

Calls GetThemeMargins() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
iPropId
prc
pMargins
Returns
Return value of GetThemeMargins() or E_NOTIMPL.
HRESULT mcGetThemeMetric ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
int  iPropId,
int *  piValue 
)

Calls GetThemeMetric() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
iPropId
piValue
Returns
Return value of GetThemeMetric() or E_NOTIMPL.
HRESULT mcGetThemePartSize ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
const RECT *  prc,
enum THEMESIZE  eSize,
SIZE *  psz 
)

Calls GetThemePartSize() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
prc
eSize
psz
Returns
Return value of GetThemePartSize() or E_NOTIMPL.
HRESULT mcGetThemePosition ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
POINT *  pPoint 
)

Calls GetThemePosition() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iPartId
iStateId
iPropId
pPoint
Returns
Return value of GetThemePosition() or E_NOTIMPL.
HRESULT mcGetThemePropertyOrigin ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
enum PROPERTYORIGIN *  pOrigin 
)

Calls GetThemePropertyOrigin() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iPartId
iStateId
iPropId
pOrigin
Returns
Return value of GetThemePropertyOrigin() or E_NOTIMPL.
HRESULT mcGetThemeRect ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
RECT *  prc 
)

Calls GetThemeRect() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iPartId
iStateId
iPropId
prc
Returns
Return value of GetThemeRect() or E_NOTIMPL.
HRESULT mcGetThemeStream ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
void **  ppvStream,
DWORD *  pcbStream,
HINSTANCE  hInst 
)

Calls GetThemeStream() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iPartId
iStateId
iPropId
ppvStream
pcbStream
hInst
Returns
Return value of GetThemeStream() or E_NOTIMPL.
HRESULT mcGetThemeString ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
WCHAR *  pszBuff,
int  cchMaxBuffChars 
)

Calls GetThemeString() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iPartId
iStateId
iPropId
pszBuff
cchMaxBuffChars
Returns
Return value of GetThemeString() or E_NOTIMPL.
BOOL mcGetThemeSysBool ( HTHEME  hTheme,
int  iBoolId 
)

Calls GetThemeSysBool() if available (and UXTHEME.DLL is in use).

If it is not, mCtrl falls back to heuristics based on information from SystemParametersInfo().

Parameters
hTheme
iBoolId
Returns
Return value of GetThemeSysBool(), or from the fallback implementation.
COLORREF mcGetThemeSysColor ( HTHEME  hTheme,
int  iColorId 
)

Calls GetThemeSysColor() if available (and UXTHEME.DLL is in use). If it is not, mCtrl falls back to GetSysColor().

Parameters
hTheme
iColorId
Returns
Return value of GetThemeSysColor(), or from GetSysColor().
HBRUSH mcGetThemeSysColorBrush ( HTHEME  hTheme,
int  iColorId 
)

Calls GetThemeSysColorBrush() if available (and UXTHEME.DLL is in use). If it is not, mCtrl falls back to implementation based on GetSysColor().

Parameters
hTheme
iColorId
Returns
Return value of GetThemeSysColor(), or from the fallback implementation.
HRESULT mcGetThemeSysFont ( HTHEME  hTheme,
int  iFontId,
LOGFONTW *  pLogFont 
)

Calls GetThemeSysFont() if available (and UXTHEME.DLL is in use). If it is not, mCtrl falls back to implementation based on SystemParameterInfo().

Parameters
hTheme
iFontId
pLogFont
Returns
Return value of GetThemeSysFont(), or a HRESULT based on success of the fallback implementation.
HRESULT mcGetThemeSysInt ( HTHEME  hTheme,
int  iIntId,
int *  piValue 
)

Calls GetThemeSysInt() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iIntId
piValue
Returns
Return value of GetThemeSysInt(), or E_NOTIMPL.
int mcGetThemeSysSize ( HTHEME  hTheme,
int  iSizeId 
)

Calls GetThemeSysSize() if available (and UXTHEME.DLL is in use), or falls back to implementation based on GetSystemMetrics().

Parameters
hTheme
iSizeId
Returns
Return value of GetThemeSysSize(), or from the fallback implementation.
HRESULT mcGetThemeSysString ( HTHEME  hTheme,
int  iStringId,
WCHAR *  pszBuff,
int  cchMaxBuffChars 
)

Calls GetThemeSysString() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iStringId
pszBuff
cchMaxBuffChars
Returns
Return value of GetThemeSysSize(), or E_NOTIMPL.
HRESULT mcGetThemeTextExtent ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
const WCHAR *  pszText,
int  cchTextMax,
DWORD  dwFlags,
const RECT *  prcBounding,
RECT *  prcExtent 
)

Calls GetThemeTextExtent() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
pszText
cchTextMax
dwFlags
prcBounding
prcExtent
Returns
Return value of GetThemeTextExtent(), or E_NOTIMPL.
HRESULT mcGetThemeTextMetrics ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
TEXTMETRIC *  pTextMetric 
)

Calls GetThemeTextMetrics() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
pTextMetric
Returns
Return value of GetThemeTextMetrics(), or E_NOTIMPL.
HRESULT mcGetThemeTransitionDuration ( HTHEME  hTheme,
int  iPartId,
int  iStateIdFrom,
int  iStateIdTo,
int  iPropId,
DWORD *  pdwDuration 
)

Calls GetThemeTransitionDuration() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
iPartId
iStateIdFrom
iStateIdTo
iPropId
pdwDuration
Returns
Return value of GetThemeTextMetrics(), or E_NOTIMPL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
HTHEME mcGetWindowTheme ( HWND  hwnd)

Calls GetWindowTheme() if available (and UXTHEME.DLL is in use), or returns NULL.

Parameters
hwnd
Returns
Return value of GetWindowTheme(), or NULL.
HRESULT mcHitTestThemeBackground ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
DWORD  dwOptions,
const RECT *  prc,
HRGN  hrgn,
POINT  ptTest,
WORD *  pwHitTestCode 
)

Calls HitTestThemeBackground() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hTheme
hdc
iPartId
iStateId
dwOptions
prc
hrgn
ptTest
pwHitTestCode
Returns
Return value of HitTestThemeBackground(), or E_NOTIMPL.
BOOL mcIsAppThemed ( void  )

Calls IsAppThemed() if available (and UXTHEME.DLL is in use), or returns FALSE.

Returns
Return value of IsAppThemed(), or FALSE.
BOOL mcIsCompositionActive ( void  )

Calls IsCompositionActive() if available (and UXTHEME.DLL is in use), or returns FALSE.

Returns
Return value of IsCompositionActive(), or FALSE.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
BOOL mcIsThemeActive ( void  )

Calls IsThemeActive() if available (and UXTHEME.DLL is in use), or returns FALSE.

Returns
Return value of IsThemeActive(), or FALSE.
BOOL mcIsThemeBackgroundPartiallyTransparent ( HTHEME  hTheme,
int  iPartId,
int  iStateId 
)

Calls IsThemeBackgroundPartiallyTransparent() if available (and UXTHEME.DLL is in use), or returns FALSE.

Parameters
hTheme
iPartId
iStateId
Returns
Return value of IsThemeBackgroundPartiallyTransparent(), or FALSE.
BOOL mcIsThemeDialogTextureEnabled ( HWND  hwnd)

Calls IsThemeDialogTextureEnabled() if available (and UXTHEME.DLL is in use), or returns FALSE.

Parameters
hwnd
Returns
Return value of IsThemeDialogTextureEnabled(), or FALSE.
BOOL mcIsThemePartDefined ( HTHEME  hTheme,
int  iPartId,
int  iStateId 
)

Calls IsThemePartDefined() if available (and UXTHEME.DLL is in use), or returns FALSE.

Parameters
hTheme
iPartId
iStateId
Returns
Return value of IsThemePartDefined(), or FALSE.
HTHEME mcOpenThemeData ( HWND  hwnd,
const WCHAR *  pszClassList 
)

Calls OpenThemeData() if available (and UXTHEME.DLL is in use), or returns MULL.

Parameters
hwnd
pszClassList
Returns
Return value of OpenThemeData(), or FALSE.
HTHEME mcOpenThemeDataEx ( HWND  hwnd,
const WCHAR *  pszClassList,
DWORD  dwFlags 
)

Calls OpenThemeDataEx() if available (and UXTHEME.DLL is in use), or returns MULL.

Parameters
hwnd
pszClassList
dwFlags
Returns
Return value of OpenThemeDataEx(), or FALSE.
void mcSetThemeAppProperties ( DWORD  dwFlags)

Calls SetThemeAppProperties() if available (and UXTHEME.DLL is in use).

Parameters
dwFlags
HRESULT mcSetWindowTheme ( HWND  hwnd,
const WCHAR *  pszSubAppName,
const WCHAR *  pszSubIdList 
)

Calls SetWindowTheme() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hwnd
pszSubAppName
pszSubIdList
Returns
Return value of SetWindowTheme(), or E_NOTIMPL.
HRESULT mcSetWindowThemeAttribute ( HWND  hwnd,
enum WINDOWTHEMEATTRIBUTETYPE  eAttribute,
void *  pvAttribute,
DWORD  cbAttribute 
)

Calls SetWindowThemeAttribute() if available (and UXTHEME.DLL is in use), or returns E_NOTIMPL.

Parameters
hwnd
eAttribute
pvAttribute
cbAttribute
Returns
Return value of SetWindowThemeAttribute(), or E_NOTIMPL.
Note
Requires _WIN32_WINNT to be 0x0600 or newer.
BOOL mcUpdatePanningFeedback ( HWND  hwnd,
LONG  lTotalOverpanOffsetX,
LONG  lTotalOverpanOffsetY,
BOOL  fInInertia 
)

Calls UpdatePanningFeedback() if available (and UXTHEME.DLL is in use), or returns FALSE.

Parameters
hwnd
lTotalOverpanOffsetX
lTotalOverpanOffsetY
fInInertia
Returns
Return value of UpdatePanningFeedback(), or FALSE.