📄 uxtheme.pas
字号:
var
GetThemeMetric: function(hTheme: HTHEME; hdc: HDC; iPartId, iStateId, iPropId: Integer;
var piVal: Integer): HRESULT; stdcall;
{$EXTERNALSYM GetThemeMetric}
//----------------------------------------------------------------------------------------------------------------------
// GetThemeString() - Get the value for the specified string property
//
// hTheme - theme data handle
// iPartId - part number
// iStateId - state number of part
// iPropId - the property number to get the value for
// pszBuff - receives the string property value
// cchMaxBuffChars - max. number of chars allowed in pszBuff
//----------------------------------------------------------------------------------------------------------------------
var
GetThemeString: function(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer; pszBuff: LPWSTR;
cchMaxBuffChars: Integer): HRESULT; stdcall;
{$EXTERNALSYM GetThemeString}
//----------------------------------------------------------------------------------------------------------------------
// GetThemeBool() - Get the value for the specified BOOL property
//
// hTheme - theme data handle
// iPartId - part number
// iStateId - state number of part
// iPropId - the property number to get the value for
// pfVal - receives the value of the property
//----------------------------------------------------------------------------------------------------------------------
var
GetThemeBool: function(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer; var pfVal: BOOL): HRESULT; stdcall;
{$EXTERNALSYM GetThemeBool}
//----------------------------------------------------------------------------------------------------------------------
// GetThemeInt() - Get the value for the specified int property
//
// 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 property
//----------------------------------------------------------------------------------------------------------------------
var
GetThemeInt: function(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer; var piVal: Integer): HRESULT; stdcall;
{$EXTERNALSYM GetThemeInt}
//----------------------------------------------------------------------------------------------------------------------
// GetThemeEnumValue() - Get the value for the specified ENUM property
//
// 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*)
//----------------------------------------------------------------------------------------------------------------------
var
GetThemeEnumValue: function(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer; var piVal: Integer): HRESULT; stdcall;
{$EXTERNALSYM GetThemeEnumValue}
//----------------------------------------------------------------------------------------------------------------------
// 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
//----------------------------------------------------------------------------------------------------------------------
var
GetThemePosition: function(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;var pPoint: TPoint): HRESULT; stdcall;
{$EXTERNALSYM GetThemePosition}
//----------------------------------------------------------------------------------------------------------------------
// 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)
//----------------------------------------------------------------------------------------------------------------------
var
GetThemeFont: function(hTheme: HTHEME; hdc: HDC; iPartId, iStateId, iPropId: Integer;
var pFont: LOGFONT): HRESULT; stdcall;
{$EXTERNALSYM GetThemeFont}
//----------------------------------------------------------------------------------------------------------------------
// 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
//----------------------------------------------------------------------------------------------------------------------
var
GetThemeRect: function(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer; var pRect: TRect): HRESULT; stdcall;
{$EXTERNALSYM GetThemeRect}
//----------------------------------------------------------------------------------------------------------------------
type
_MARGINS = record
cxLeftWidth: Integer; // width of left border that retains its size
cxRightWidth: Integer; // width of right border that retains its size
cyTopHeight: Integer; // height of top border that retains its size
cyBottomHeight: Integer; // height of bottom border that retains its size
end;
{$EXTERNALSYM _MARGINS}
MARGINS = _MARGINS;
{$EXTERNALSYM MARGINS}
PMARGINS = ^MARGINS;
{$EXTERNALSYM PMARGINS}
TMargins = MARGINS;
//----------------------------------------------------------------------------------------------------------------------
// 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
//----------------------------------------------------------------------------------------------------------------------
var
GetThemeMargins: function(hTheme: HTHEME; hdc: HDC; iPartId, iStateId, iPropId: Integer; prc: PRECT;
var pMargins: MARGINS): HRESULT; stdcall;
{$EXTERNALSYM GetThemeMargins}
//----------------------------------------------------------------------------------------------------------------------
const
MAX_INTLIST_COUNT = 10;
{$EXTERNALSYM MAX_INTLIST_COUNT}
type
_INTLIST = record
iValueCount: Integer; // number of values in iValues
iValues: array [0..MAX_INTLIST_COUNT - 1] of Integer;
end;
{$EXTERNALSYM _INTLIST}
INTLIST = _INTLIST;
{$EXTERNALSYM INTLIST}
PINTLIST = ^INTLIST;
{$EXTERNALSYM PINTLIST}
TIntList = INTLIST;
//----------------------------------------------------------------------------------------------------------------------
// 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
//----------------------------------------------------------------------------------------------------------------------
var
GetThemeIntList: function(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer; var pIntList: INTLIST): HRESULT; stdcall;
{$EXTERNALSYM GetThemeIntList}
//----------------------------------------------------------------------------------------------------------------------
type
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
{$EXTERNALSYM PROPERTYORIGIN}
TPropertyOrigin = 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
//----------------------------------------------------------------------------------------------------------------------
var
GetThemePropertyOrigin: function(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
var pOrigin: PROPERTYORIGIN): HRESULT; stdcall;
{$EXTERNALSYM GetThemePropertyOrigin}
//----------------------------------------------------------------------------------------------------------------------
// 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.
//----------------------------------------------------------------------------------------------------------------------
var
SetWindowTheme: function(hwnd: HWND; pszSubAppName: LPCWSTR; pszSubIdList: LPCWSTR): HRESULT; stdcall;
{$EXTERNALSYM SetWindowTheme}
//----------------------------------------------------------------------------------------------------------------------
// 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
//----------------------------------------------------------------------------------------------------------------------
var
GetThemeFilename: function(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer; pszThemeFileName: LPWSTR;
cchMaxBuffChars: Integer): HRESULT; stdcall;
{$EXTERNALSYM GetThemeFilename}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -