SetThreadDpiAwarenessContext function

Set the DPI awareness for the current thread to the provided value.

Syntax

DPI_AWARENESS_CONTEXT SetThreadDpiAwarenessContext(
  DPI_AWARENESS_CONTEXT dpiContext
);

Parameters

dpiContext

The new DPI_AWARENESS_CONTEXT for the current thread. This context includes the DPI_AWARENESS value.

Return Value

The old DPI_AWARENESS_CONTEXT for the thread. If the dpiContext is invalid, the thread will not be updated and the return value will be NULL. You can use this value to restore the old DPI_AWARENESS_CONTEXT after overriding it with a predefined value.

Remarks

Use this API to change the DPI_AWARENESS_CONTEXT for the thread from the default value for the app.

Requirements

   
Minimum supported client Windows 10, version 1607 [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

DPI_AWARENESS