User32SetThreadDpiAwarenessContext Method

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

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", ExactSpelling = true)]
public static IntPtr SetThreadDpiAwarenessContext(
	IntPtr dpiContext
)

Parameters

dpiContext  IntPtr
The new DPI_AWARENESS_CONTEXT for the current thread. This context includes the DpiAwareness value.

Return Value

IntPtr
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

See Also