Skip to content

Commit

Permalink
test dynamic linking user32 funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
nulano committed Nov 7, 2024
1 parent f682197 commit 337a425
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,14 @@ PyImaging_GrabScreenWin32(PyObject *self, PyObject *args) {
GetWindowDpiAwarenessContext_function = (Func_GetWindowDpiAwarenessContext
)GetProcAddress(user32, "GetWindowDpiAwarenessContext");
DPI_AWARENESS_CONTEXT dpiAwarenessContext =
GetWindowDpiAwarenessContext_function(wnd);
GetWindowDpiAwarenessContext(wnd);
if (dpiAwarenessContext != NULL) {
dpiAwareness =
SetThreadDpiAwarenessContext_function(dpiAwarenessContext);
}
} else {
// DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = ((DPI_CONTEXT_HANDLE)-3)
dpiAwareness = SetThreadDpiAwarenessContext_function((HANDLE)-3);
dpiAwareness = SetThreadDpiAwarenessContext((HANDLE)-3);
}
}

Expand All @@ -392,7 +392,7 @@ PyImaging_GrabScreenWin32(PyObject *self, PyObject *args) {
}

if (SetThreadDpiAwarenessContext_function != NULL) {
SetThreadDpiAwarenessContext_function(dpiAwareness);
SetThreadDpiAwarenessContext(dpiAwareness);
}

FreeLibrary(user32);
Expand Down

0 comments on commit 337a425

Please sign in to comment.