User32SetThreadDpiAwarenessContext Method
Set the DPI awareness for the current thread to the provided value.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("User32.dll", ExactSpelling := true>]
Public Shared Function SetThreadDpiAwarenessContext (
dpiContext As IntPtr
) As IntPtr
Dim dpiContext As IntPtr
Dim returnValue As IntPtr
returnValue = User32.SetThreadDpiAwarenessContext(dpiContext)
public:
[DllImportAttribute(L"User32.dll", ExactSpelling = true)]
static IntPtr SetThreadDpiAwarenessContext(
IntPtr dpiContext
)
[<DllImportAttribute("User32.dll", ExactSpelling = true)>]
static member SetThreadDpiAwarenessContext :
dpiContext : IntPtr -> IntPtr
No code example is currently available or this language may not be supported.
- dpiContext IntPtr
-
The new DPI_AWARENESS_CONTEXT for the current thread. This context includes the DpiAwareness 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.