mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-04 20:03:20 +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");
|
user32 = LoadLibraryA("User32.dll");
|
||||||
SetThreadDpiAwarenessContext_function = (Func_SetThreadDpiAwarenessContext
|
SetThreadDpiAwarenessContext_function = (Func_SetThreadDpiAwarenessContext
|
||||||
)GetProcAddress(user32, "SetThreadDpiAwarenessContext");
|
)GetProcAddress(user32, "SetThreadDpiAwarenessContext");
|
||||||
GetWindowDpiAwarenessContext_function = (Func_GetWindowDpiAwarenessContext
|
|
||||||
)GetProcAddress(user32, "GetWindowDpiAwarenessContext");
|
|
||||||
if (SetThreadDpiAwarenessContext_function != NULL) {
|
if (SetThreadDpiAwarenessContext_function != NULL) {
|
||||||
|
GetWindowDpiAwarenessContext_function = (Func_GetWindowDpiAwarenessContext
|
||||||
|
)GetProcAddress(user32, "GetWindowDpiAwarenessContext");
|
||||||
if (screens == -1 && GetWindowDpiAwarenessContext_function != NULL) {
|
if (screens == -1 && GetWindowDpiAwarenessContext_function != NULL) {
|
||||||
dpiAwareness =
|
dpiAwareness =
|
||||||
GetWindowDpiAwarenessContext_function(wnd);
|
GetWindowDpiAwarenessContext_function(wnd);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user