SystemParametersInfoForDpi function (winuser.h)
Retrieves the value of one of the system-wide parameters, taking into account the provided DPI value.
Syntax
BOOL SystemParametersInfoForDpi(
[in] UINT uiAction,
[in] UINT uiParam,
[in, out] PVOID pvParam,
[in] UINT fWinIni,
[in] UINT dpi
);
Parameters
[in] uiAction
The system-wide parameter to be retrieved. This function is only intended for use with SPI_GETICONTITLELOGFONT, SPI_GETICONMETRICS, or SPI_GETNONCLIENTMETRICS. See SystemParametersInfo for more information on these values.
[in] uiParam
A parameter whose usage and format depends on the system parameter being queried. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify zero for this parameter.
[in, out] pvParam
A parameter whose usage and format depends on the system parameter being queried. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify NULL for this parameter. For information on the PVOID datatype, see Windows Data Types.
[in] fWinIni
Has no effect for with this API. This parameter only has an effect if you're setting parameter.
[in] dpi
The DPI to use for scaling the metric.
Return value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
This function returns a similar result as SystemParametersInfo, but scales it according to an arbitrary DPI you provide (if appropriate). It only scales with the following possible values for uiAction: SPI_GETICONTITLELOGFONT, SPI_GETICONMETRICS, SPI_GETNONCLIENTMETRICS. Other possible uiAction values do not provide ForDPI behavior, and therefore this function returns 0 if called with them.
For uiAction values that contain strings within their associated structures, only Unicode (LOGFONTW) strings are supported in this function.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 10, version 1607 [desktop apps only] |
Minimum supported server | Windows Server 2016 [desktop apps only] |
Target Platform | Windows |
Header | winuser.h (include Windows.h) |
Library | User32.lib |
DLL | User32.dll |