📄 uxtheme.h
字号:
//
// hTheme - theme data handle
// iPartId - part number
// iStateId - state number of part
// iPropId - the property number to get the value for
// piVal - receives the value of the enum (cast to int*)
//-----------------------------------------------------------------------
THEMEAPI GetThemeEnumValue(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, OUT int *piVal);
//-----------------------------------------------------------------------
// GetThemePosition() - Get the value for the specified position
// property
//
// hTheme - theme data handle
// iPartId - part number
// iStateId - state number of part
// iPropId - the property number to get the value for
// pPoint - receives the value of the position property
//-----------------------------------------------------------------------
THEMEAPI GetThemePosition(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, OUT POINT *pPoint);
//-----------------------------------------------------------------------
// GetThemeFont() - Get the value for the specified font property
//
// hTheme - theme data handle
// hdc - (optional) hdc to be drawn to (DPI scaling)
// iPartId - part number
// iStateId - state number of part
// iPropId - the property number to get the value for
// pFont - receives the value of the LOGFONT property
// (scaled for the current logical screen dpi)
//-----------------------------------------------------------------------
THEMEAPI GetThemeFont(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId,
int iStateId, int iPropId, OUT LOGFONT *pFont);
//-----------------------------------------------------------------------
// GetThemeRect() - Get the value for the specified RECT property
//
// hTheme - theme data handle
// iPartId - part number
// iStateId - state number of part
// iPropId - the property number to get the value for
// pRect - receives the value of the RECT property
//-----------------------------------------------------------------------
THEMEAPI GetThemeRect(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, OUT RECT *pRect);
//-----------------------------------------------------------------------
typedef struct _MARGINS
{
int cxLeftWidth; // width of left 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 cyBottomHeight; // height of bottom border that retains its size
} MARGINS, *PMARGINS;
//-----------------------------------------------------------------------
// GetThemeMargins() - Get the value for the specified MARGINS property
//
// hTheme - theme data handle
// hdc - (optional) hdc to be used for drawing
// iPartId - part number
// iStateId - state number of part
// iPropId - the property number to get the value for
// prc - RECT for area to be drawn into
// pMargins - receives the value of the MARGINS property
//-----------------------------------------------------------------------
THEMEAPI GetThemeMargins(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId,
int iStateId, int iPropId, OPTIONAL RECT *prc, OUT MARGINS *pMargins);
//-----------------------------------------------------------------------
#define MAX_INTLIST_COUNT 10
typedef struct _INTLIST
{
int iValueCount; // number of values in iValues
int iValues[MAX_INTLIST_COUNT];
} INTLIST, *PINTLIST;
//-----------------------------------------------------------------------
// GetThemeIntList() - Get the value for the specified INTLIST struct
//
// hTheme - theme data handle
// iPartId - part number
// iStateId - state number of part
// iPropId - the property number to get the value for
// pIntList - receives the value of the INTLIST property
//-----------------------------------------------------------------------
THEMEAPI GetThemeIntList(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, OUT INTLIST *pIntList);
//-----------------------------------------------------------------------
typedef enum PROPERTYORIGIN
{
PO_STATE, // property was found in the state section
PO_PART, // property was found in the part section
PO_CLASS, // property was found in the class section
PO_GLOBAL, // property was found in [globals] section
PO_NOTFOUND // property was not found
} PROPERTYORIGIN;
//-----------------------------------------------------------------------
// GetThemePropertyOrigin()
// - searches for the specified theme property
// and sets "pOrigin" to indicate where it was
// found (or not found)
//
// hTheme - theme data handle
// iPartId - part number
// iStateId - state number of part
// iPropId - the property number to search for
// pOrigin - receives the value of the property origin
//-----------------------------------------------------------------------
THEMEAPI GetThemePropertyOrigin(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, OUT enum PROPERTYORIGIN *pOrigin);
//---------------------------------------------------------------------------
// SetWindowTheme()
// - redirects an existing Window to use a different
// section of the current theme information than its
// class normally asks for.
//
// hwnd - the handle of the window (cannot be NULL)
//
// pszSubAppName - app (group) name to use in place of the calling
// app's name. If NULL, the actual calling app
// name will be used.
//
// pszSubIdList - semicolon separated list of class Id names to
// use in place of actual list passed by the
// window's class. if NULL, the id list from the
// calling class is used.
//---------------------------------------------------------------------------
// The Theme Manager will remember the "pszSubAppName" and the
// "pszSubIdList" associations thru the lifetime of the window (even
// if themes are subsequently changed). The window is sent a
// "WM_THEMECHANGED" msg at the end of this call, so that the new
// theme can be found and applied.
//---------------------------------------------------------------------------
// When "pszSubAppName" or "pszSubIdList" are NULL, the Theme Manager
// removes the previously remember association. To turn off theme-ing for
// the specified window, you can pass an empty string (L"") so it
// won't match any section entries.
//---------------------------------------------------------------------------
THEMEAPI SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName,
LPCWSTR pszSubIdList);
//---------------------------------------------------------------------------
// GetThemeFilename() - Get the value for the specified FILENAME property.
//
// hTheme - theme data handle
// iPartId - part number
// iStateId - state number of part
// iPropId - the property number to search for
// pszThemeFileName - output buffer to receive the filename
// cchMaxBuffChars - the size of the return buffer, in chars
//---------------------------------------------------------------------------
THEMEAPI GetThemeFilename(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, OUT LPWSTR pszThemeFileName, int cchMaxBuffChars);
//---------------------------------------------------------------------------
// GetThemeSysColor() - Get the value of the specified System color.
//
// hTheme - the theme data handle. if non-NULL, will return
// color from [SysMetrics] section of theme.
// if NULL, will return the global system color.
//
// iColorId - the system color index defined in winuser.h
//---------------------------------------------------------------------------
THEMEAPI_(COLORREF) GetThemeSysColor(HTHEME hTheme, int iColorId);
//---------------------------------------------------------------------------
// GetThemeSysColorBrush()
// - Get the brush for the specified System color.
//
// hTheme - the theme data handle. if non-NULL, will return
// brush matching color from [SysMetrics] section of
// theme. if NULL, will return the brush matching
// global system color.
//
// iColorId - the system color index defined in winuser.h
//---------------------------------------------------------------------------
THEMEAPI_(HBRUSH) GetThemeSysColorBrush(HTHEME hTheme, int iColorId);
//---------------------------------------------------------------------------
// GetThemeSysBool() - Get the boolean value of specified System metric.
//
// hTheme - the theme data handle. if non-NULL, will return
// BOOL from [SysMetrics] section of theme.
// if NULL, will return the specified system boolean.
//
// iBoolId - the TMT_XXX BOOL number (first BOOL
// is TMT_FLATMENUS)
//---------------------------------------------------------------------------
THEMEAPI_(BOOL) GetThemeSysBool(HTHEME hTheme, int iBoolId);
//---------------------------------------------------------------------------
// GetThemeSysSize() - Get the value of the specified System size metric.
// (scaled for the current logical screen dpi)
//
// hTheme - the theme data handle. if non-NULL, will return
// size from [SysMetrics] section of theme.
// if NULL, will return the global system metric.
//
// iSizeId - the following values are supported when
// hTheme is non-NULL:
//
// SM_CXBORDER (border width)
// SM_CXVSCROLL (scrollbar width)
// SM_CYHSCROLL (scrollbar height)
// SM_CXSIZE (caption width)
// SM_CYSIZE (caption height)
// SM_CXSMSIZE (small caption width)
// SM_CYSMSIZE (small caption height)
// SM_CXMENUSIZE (menubar width)
// SM_CYMENUSIZE (menubar height)
//
// when hTheme is NULL, iSizeId is passed directly
// to the GetSystemMetrics() function
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -