mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-05 18:03:17 +03:00
try/except ctypes.windll.user32.CalculatePopupWindowPosition
As we can't rely on the is_wine check, use an exception for this.
This commit is contained in:
parent
e515c5b3e0
commit
5effd044ac
33
prefs.py
33
prefs.py
@ -206,19 +206,28 @@ elif platform == 'win32':
|
|||||||
|
|
||||||
CalculatePopupWindowPosition = None
|
CalculatePopupWindowPosition = None
|
||||||
if not is_wine:
|
if not is_wine:
|
||||||
CalculatePopupWindowPosition = ctypes.windll.user32.CalculatePopupWindowPosition
|
try:
|
||||||
CalculatePopupWindowPosition.argtypes = [
|
CalculatePopupWindowPosition = ctypes.windll.user32.CalculatePopupWindowPosition
|
||||||
ctypes.POINTER(POINT),
|
|
||||||
ctypes.POINTER(SIZE),
|
|
||||||
UINT,
|
|
||||||
ctypes.POINTER(RECT),
|
|
||||||
ctypes.POINTER(RECT)
|
|
||||||
]
|
|
||||||
|
|
||||||
GetParent = ctypes.windll.user32.GetParent
|
except AttributeError as e:
|
||||||
GetParent.argtypes = [HWND]
|
logger.error(
|
||||||
GetWindowRect = ctypes.windll.user32.GetWindowRect
|
'win32 and not is_wine, but ctypes.windll.user32.CalculatePopupWindowPosition invalid',
|
||||||
GetWindowRect.argtypes = [HWND, ctypes.POINTER(RECT)]
|
exc_info=e
|
||||||
|
)
|
||||||
|
|
||||||
|
else:
|
||||||
|
CalculatePopupWindowPosition.argtypes = [
|
||||||
|
ctypes.POINTER(POINT),
|
||||||
|
ctypes.POINTER(SIZE),
|
||||||
|
UINT,
|
||||||
|
ctypes.POINTER(RECT),
|
||||||
|
ctypes.POINTER(RECT)
|
||||||
|
]
|
||||||
|
|
||||||
|
GetParent = ctypes.windll.user32.GetParent
|
||||||
|
GetParent.argtypes = [HWND]
|
||||||
|
GetWindowRect = ctypes.windll.user32.GetWindowRect
|
||||||
|
GetWindowRect.argtypes = [HWND, ctypes.POINTER(RECT)]
|
||||||
|
|
||||||
SHGetLocalizedName = ctypes.windll.shell32.SHGetLocalizedName
|
SHGetLocalizedName = ctypes.windll.shell32.SHGetLocalizedName
|
||||||
SHGetLocalizedName.argtypes = [LPCWSTR, LPWSTR, UINT, ctypes.POINTER(ctypes.c_int)]
|
SHGetLocalizedName.argtypes = [LPCWSTR, LPWSTR, UINT, ctypes.POINTER(ctypes.c_int)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user