Browse Source
Merge pull request #2037 from AvaloniaUI/fixes/dpi-intptr-fail
Fix checks for DPI APIs.
pull/2039/head
danwalmsley
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
src/Windows/Avalonia.Win32/Win32Platform.cs
|
|
|
@ -247,7 +247,7 @@ namespace Avalonia.Win32 |
|
|
|
var user32 = LoadLibrary("user32.dll"); |
|
|
|
var method = GetProcAddress(user32, nameof(SetProcessDpiAwarenessContext)); |
|
|
|
|
|
|
|
if (method != null) |
|
|
|
if (method != IntPtr.Zero) |
|
|
|
{ |
|
|
|
if (SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) || |
|
|
|
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE)) |
|
|
|
@ -259,7 +259,7 @@ namespace Avalonia.Win32 |
|
|
|
var shcore = LoadLibrary("shcore.dll"); |
|
|
|
method = GetProcAddress(shcore, nameof(SetProcessDpiAwareness)); |
|
|
|
|
|
|
|
if (method != null) |
|
|
|
if (method != IntPtr.Zero) |
|
|
|
{ |
|
|
|
SetProcessDpiAwareness(PROCESS_DPI_AWARENESS.PROCESS_PER_MONITOR_DPI_AWARE); |
|
|
|
return; |
|
|
|
|