1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-24 12:40:52 +03:00

monitor: Properly prototype EnumWindows

This commit is contained in:
Athanasius 2023-01-12 16:04:44 +00:00
parent e5709727b6
commit aaf83645f7
No known key found for this signature in database
GPG Key ID: 772697E181BB2767

View File

@ -49,13 +49,20 @@ if sys.platform == 'darwin':
elif sys.platform == 'win32':
import ctypes
from ctypes import WINFUNCTYPE, windll
from ctypes.wintypes import BOOL, HWND, LPARAM, LPWSTR
from watchdog.events import FileCreatedEvent, FileSystemEventHandler
from watchdog.observers import Observer
EnumWindows = ctypes.windll.user32.EnumWindows
EnumWindowsProc = ctypes.WINFUNCTYPE(BOOL, HWND, LPARAM)
# BOOL EnumWindows(
# [in] WNDENUMPROC lpEnumFunc,
# [in] LPARAM lParam
# );
EnumWindowsProc = WINFUNCTYPE(BOOL, HWND, LPARAM)
prototype = WINFUNCTYPE(BOOL, EnumWindowsProc, LPARAM)
paramflags = (1, "lpEnumFunc"), (1, "lParam")
EnumWindows = prototype(("EnumWindows", windll.user32), paramflags)
CloseHandle = ctypes.windll.kernel32.CloseHandle