📄 jwauxtheme.pas
字号:
// Resizing border is specified as a template, not just window edges.
// This option is mutually exclusive with HTTB_SYSTEMSIZINGWIDTH; HTTB_SIZINGTEMPLATE takes precedence
HTTB_SIZINGTEMPLATE = $0100;
{$EXTERNALSYM HTTB_SIZINGTEMPLATE}
// Use system resizing border width rather than theme content margins.
// This option is mutually exclusive with HTTB_SIZINGTEMPLATE, which takes precedence.
HTTB_SYSTEMSIZINGMARGINS = $0200;
{$EXTERNALSYM HTTB_SYSTEMSIZINGMARGINS}
//-------------------------------------------------------------------------
// HitTestThemeBackground()
// - returns a HitTestCode (a subset of the values
// returned by WM_NCHITTEST) for the point "ptTest"
// within the theme-specified background
// (bound by pRect). "pRect" and "ptTest" should
// both be in the same coordinate system
// (client, screen, etc).
//
// hTheme - theme data handle
// hdc - HDC to draw into
// iPartId - part number to test against
// iStateId - state number (of the part)
// pRect - the RECT used to draw the part
// hrgn - optional region to use; must be in same coordinates as
// - pRect and pTest.
// ptTest - the hit point to be tested
// dwOptions - HTTB_xxx constants
// pwHitTestCode - receives the returned hit test code - one of:
//
// HTNOWHERE, HTLEFT, HTTOPLEFT, HTBOTTOMLEFT,
// HTRIGHT, HTTOPRIGHT, HTBOTTOMRIGHT,
// HTTOP, HTBOTTOM, HTCLIENT
//-------------------------------------------------------------------------
function HitTestThemeBackground(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer;
dwOptions: DWORD; const pRect: RECT; hrgn: HRGN; ptTest: POINT; var pwHitTestCode: WORD): HRESULT; stdcall;
{$EXTERNALSYM HitTestThemeBackground}
//------------------------------------------------------------------------
// DrawThemeEdge() - Similar to the DrawEdge() API, but uses part colors
// and is high-DPI aware
// hTheme - theme data handle
// hdc - HDC to draw into
// iPartId - part number to draw
// iStateId - state number of part
// pDestRect - the RECT used to draw the line(s)
// uEdge - Same as DrawEdge() API
// uFlags - Same as DrawEdge() API
// pContentRect - Receives the interior rect if (uFlags & BF_ADJUST)
//------------------------------------------------------------------------
function DrawThemeEdge(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer;
const pDestRect: RECT; uEdge, uFlags: UINT; pContentRect: PRECT): HRESULT; stdcall;
{$EXTERNALSYM DrawThemeEdge}
//------------------------------------------------------------------------
// DrawThemeIcon() - draws an image within an imagelist based on
// a (possible) theme-defined effect.
//
// hTheme - theme data handle
// hdc - HDC to draw into
// iPartId - part number to draw
// iStateId - state number of part
// pRect - the RECT to draw the image within
// himl - handle to IMAGELIST
// iImageIndex - index into IMAGELIST (which icon to draw)
//------------------------------------------------------------------------
function DrawThemeIcon(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer;
const pRect: RECT; himl: HIMAGELIST; iImageIndex: Integer): HRESULT; stdcall;
{$EXTERNALSYM DrawThemeIcon}
//---------------------------------------------------------------------------
// IsThemePartDefined() - returns TRUE if the theme has defined parameters
// for the specified "iPartId" and "iStateId".
//
// hTheme - theme data handle
// iPartId - part number to find definition for
// iStateId - state number of part
//---------------------------------------------------------------------------
function IsThemePartDefined(hTheme: HTHEME; iPartId, iStateId: Integer): BOOL; stdcall;
{$EXTERNALSYM IsThemePartDefined}
//---------------------------------------------------------------------------
// IsThemeBackgroundPartiallyTransparent()
// - returns TRUE if the theme specified background for
// the part/state has transparent pieces or
// alpha-blended pieces.
//
// hTheme - theme data handle
// iPartId - part number
// iStateId - state number of part
//---------------------------------------------------------------------------
function IsThemeBackgroundPartiallyTransparent(hTheme: HTHEME; iPartId, iStateId: Integer): BOOL; stdcall;
{$EXTERNALSYM IsThemeBackgroundPartiallyTransparent}
//---------------------------------------------------------------------------
// lower-level theme information services
//---------------------------------------------------------------------------
// The following methods are getter routines for each of the Theme Data types.
// 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
// described in "states" (ex: disabled, hot, pressed).
//---------------------------------------------------------------------------
// Each of the below methods takes a "iPartId" param to specify the
// part and a "iStateId" to specify the state of the part.
// "iStateId=0" refers to the root part. "iPartId" = "0" refers to
// the root class.
//-----------------------------------------------------------------------
// Each method also take a "iPropId" param because multiple instances of
// the same primitive type can be defined in the theme schema.
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// GetThemeColor() - Get the value for the specified COLOR property
//
// hTheme - theme data handle
// iPartId - part number
// iStateId - state number of part
// iPropId - the property number to get the value for
// pColor - receives the value of the property
//-----------------------------------------------------------------------
function GetThemeColor(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
var pColor: COLORREF): HRESULT; stdcall;
{$EXTERNALSYM GetThemeColor}
//-----------------------------------------------------------------------
// GetThemeMetric() - Get the value for the specified metric/size
// property
//
// hTheme - theme data handle
// hdc - (optional) hdc to be drawn into (DPI scaling)
// iPartId - part number
// iStateId - state number of part
// iPropId - the property number to get the value for
// piVal - receives the value of the property
//-----------------------------------------------------------------------
function GetThemeMetric(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
//-----------------------------------------------------------------------
function GetThemeString(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
//-----------------------------------------------------------------------
function GetThemeBool(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
//-----------------------------------------------------------------------
function GetThemeInt(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*)
//-----------------------------------------------------------------------
function GetThemeEnumValue(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
//-----------------------------------------------------------------------
function GetThemePosition(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
var pPoint: POINT): 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)
//-----------------------------------------------------------------------
function GetThemeFont(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
//-----------------------------------------------------------------------
function GetThemeRect(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
var pRect: RECT): 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
//-----------------------------------------------------------------------
function GetThemeMargins(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
//-----------------------------------------------------------------------
function GetThemeIntList(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
//-----------------------------------------------------------------------
function GetThemePropertyOrigin(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
var pOrigin: PROPERTYORIGIN): HRESULT; stdcall;
{$EXTERNALSYM GetThemePropertyOrigin}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -