From e5709727b6432b8237992a8b5c39742f767402a4 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 12 Jan 2023 15:52:49 +0000 Subject: [PATCH] monitor: Rename GetWindowTextLength to GetWindowTextLengthW It's using the win32/user32 GetWindowTextLengthW() so name it appropriately. --- monitor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitor.py b/monitor.py index 049e75da..488f8564 100644 --- a/monitor.py +++ b/monitor.py @@ -61,7 +61,7 @@ elif sys.platform == 'win32': GetWindowText = ctypes.windll.user32.GetWindowTextW GetWindowText.argtypes = [HWND, LPWSTR, ctypes.c_int] - GetWindowTextLength = ctypes.windll.user32.GetWindowTextLengthW + GetWindowTextLengthW = ctypes.windll.user32.GetWindowTextLengthW GetProcessHandleFromHwnd = ctypes.windll.oleacc.GetProcessHandleFromHwnd @@ -2032,7 +2032,7 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below elif sys.platform == 'win32': def WindowTitle(h): # noqa: N802 # type: ignore if h: - length = GetWindowTextLength(h) + 1 + length = GetWindowTextLengthW(h) + 1 buf = ctypes.create_unicode_buffer(length) if GetWindowText(h, buf, length): return buf.value