SetThreadDpiAwarenessContext function

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

Syntax


DPI_AWARENESS_CONTEXT WINAPI SetThreadDpiAwarenessContext(
  _In_  DPI_AWARENESS_CONTEXT  dpiContext
);

Parameters

dpiContext [in]

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 [desktop apps only]

Minimum supported server

None supported

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

DPI_AWARENESS

 

 

Show: