mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 02:06:18 +03:00
Do not load GetWindowDpiAwarenessContext until its needed
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
4b8867069b
commit
a6c941ac2c
|
@ -359,9 +359,9 @@ PyImaging_GrabScreenWin32(PyObject *self, PyObject *args) {
|
|||
user32 = LoadLibraryA("User32.dll");
|
||||
SetThreadDpiAwarenessContext_function = (Func_SetThreadDpiAwarenessContext
|
||||
)GetProcAddress(user32, "SetThreadDpiAwarenessContext");
|
||||
GetWindowDpiAwarenessContext_function = (Func_GetWindowDpiAwarenessContext
|
||||
)GetProcAddress(user32, "GetWindowDpiAwarenessContext");
|
||||
if (SetThreadDpiAwarenessContext_function != NULL) {
|
||||
GetWindowDpiAwarenessContext_function = (Func_GetWindowDpiAwarenessContext
|
||||
)GetProcAddress(user32, "GetWindowDpiAwarenessContext");
|
||||
if (screens == -1 && GetWindowDpiAwarenessContext_function != NULL) {
|
||||
dpiAwareness =
|
||||
GetWindowDpiAwarenessContext_function(wnd);
|
||||
|
|
Loading…
Reference in New Issue
Block a user