SetDialogDpiChangeBehavior function (winuser.h)
Dialogs in Per-Monitor v2 contexts are automatically DPI scaled. This method lets you customize their DPI change behavior.
This function works in conjunction with the DIALOG_DPI_CHANGE_BEHAVIORS enum in order to override the default DPI scaling behavior for dialogs. This function is called on a specified dialog, for which the specified flags are individually saved.
This function does not affect the DPI scaling behavior for the child windows of the dialog in question - that is done with SetDialogControlDpiChangeBehavior.
Syntax
BOOL SetDialogDpiChangeBehavior(
HWND hDlg,
DIALOG_DPI_CHANGE_BEHAVIORS mask,
DIALOG_DPI_CHANGE_BEHAVIORS values
);
Parameters
hDlg
A handle for the dialog whose behavior will be modified.
mask
A mask specifying the subset of flags to be changed.
values
The desired value to be set for the specified subset of flags.
Return value
This function returns TRUE if the operation was successful, and FALSE otherwise. To get extended error information, call GetLastError.
Possible errors are ERROR_INVALID_HANDLE if passed an invalid dialog HWND, and ERROR_ACCESS_DENIED if the dialog belongs to another process.
Remarks
For extensibility, DIALOG_DPI_CHANGE_BEHAVIORS was modeled as a set of bit-flags representing separate behaviors. This function follows the typical two-parameter approach to setting flags, where a mask specifies the subset of the flags to be changed.
It is not an error to call this API outside of Per Monitor v2 contexts, though the flags will have no effect on the behavior of the specified dialog until the context is changed to Per Monitor v2.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 10, version 1703 [desktop apps only] |
Minimum supported server | Windows Server 2016 [desktop apps only] |
Target Platform | Windows |
Header | winuser.h |
Library | User32.lib |
DLL | User32.dll |