GetThemeMetric function (uxtheme.h)
Retrieves the value of a metric property.
Syntax
HRESULT GetThemeMetric(
[in] HTHEME hTheme,
[in] HDC hdc,
[in] int iPartId,
[in] int iStateId,
[in] int iPropId,
[out] int *piVal
);
Parameters
[in] hTheme
Type: HTHEME
Handle to a window's specified theme data. Use OpenThemeData to create an HTHEME.
[in] hdc
Type: HDC
HDC. This parameter may be set to NULL.
[in] iPartId
Type: int
Value of type int that specifies the part that contains the metric property. See Parts and States.
[in] iStateId
Type: int
Value of type int that specifies the state of the part. See Parts and States.
[in] iPropId
Type: int
Value of type int that specifies the property to retrieve. Can be one of the following values.
Value | Meaning |
---|---|
|
The alpha value (0-255) used for DrawThemeIcon. |
|
The minimum alpha value (0-255) that a pixel must be to be considered opaque. |
|
The thickness of the border drawn if this part uses a border fill. |
|
The character index into the selected font that will be used for the glyph, if the part uses a font-based glyph. |
|
The amount of the first gradient color to use in drawing the part. This value can be from 0 to 255, but this value plus the values of each of the GRADIENTRATIO values must add up to 255. See the TMT_GRADIENTCOLOR1 value of GetThemeColor. |
|
The amount of the second gradient color to use in drawing the part. |
|
The amount of the third gradient color to use in drawing the part. |
|
The amount of the fourth gradient color to use in drawing the part. |
|
The amount of the fifth gradient color to use in drawing the part. |
|
The height of the part. |
|
The number of state images present in an image file. |
|
The minimum dpi that the first image file was designed for. See GetThemeFilename. |
|
The minimum dpi that the second image file was designed for. |
|
The minimum dpi that the third image file was designed for. |
|
The minimum dpi that the fourth image file was designed for. |
|
The minimum dpi that the fifth image file was designed for. |
|
The size of the progress control "chunk" shapes that define how far an operation has progressed. |
|
The total size of all of the progress control "chunks". |
|
The roundness (0-100%) of the part's corners. |
|
The roundness (0-100%) of the part's corners. |
|
The amount of saturation (0-255) to apply to an icon drawn using DrawThemeIcon. |
|
The thickness of the border drawn around text characters. |
|
The percentage of a true-size image's original size at which the image will be stretched. |
|
The width of the part. |
[out] piVal
Type: int*
Pointer to an int that receives the metric property value.
Return value
Type: HRESULT
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | uxtheme.h |
Library | UxTheme.lib |
DLL | UxTheme.dll |