mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
protocol.py: Change definition of DefWindowProcW to work on 64-bit
Given this is the form of definition in the official Python docs I'm wondering if this only ever worked on 32-bit by accident. So, it was nothing to do with the type needing to be changed for 64-bit. The error: ctypes.ArgumentError: argument 4: <class 'OverflowError'>: int too long to convert was a red herring in those terms.
This commit is contained in:
parent
ee1df33cec
commit
f141fccd86
12
protocol.py
12
protocol.py
@ -106,12 +106,12 @@ if sys.platform == 'darwin' and getattr(sys, 'frozen', False): # noqa: C901 # i
|
|||||||
|
|
||||||
def handleEvent_withReplyEvent_(self, event, replyEvent) -> None: # noqa: N802 N803 # Required to override
|
def handleEvent_withReplyEvent_(self, event, replyEvent) -> None: # noqa: N802 N803 # Required to override
|
||||||
"""Actual event handling from NSAppleEventManager."""
|
"""Actual event handling from NSAppleEventManager."""
|
||||||
protocolhandler.lasturl = urllib.parse.unquote( # noqa: F821: type: ignore # Its going to be a DPH in
|
protocolhandler.lasturl = urllib.parse.unquote( # noqa: F821: type: ignore # It's going to be a DPH in
|
||||||
# this code
|
# this code
|
||||||
event.paramDescriptorForKeyword_(keyDirectObject).stringValue()
|
event.paramDescriptorForKeyword_(keyDirectObject).stringValue()
|
||||||
).strip()
|
).strip()
|
||||||
|
|
||||||
protocolhandler.master.after(DarwinProtocolHandler.POLL, protocolhandler.poll) # noqa: F821: type: ignore
|
protocolhandler.master.after(DarwinProtocolHandler.POLL, protocolhandler.poll) # noqa: F821 # type: ignore
|
||||||
|
|
||||||
|
|
||||||
elif (config.auth_force_edmc_protocol
|
elif (config.auth_force_edmc_protocol
|
||||||
@ -157,7 +157,13 @@ elif (config.auth_force_edmc_protocol
|
|||||||
CreateWindowExW.restype = HWND
|
CreateWindowExW.restype = HWND
|
||||||
RegisterClassW = windll.user32.RegisterClassW
|
RegisterClassW = windll.user32.RegisterClassW
|
||||||
RegisterClassW.argtypes = [POINTER(WNDCLASS)]
|
RegisterClassW.argtypes = [POINTER(WNDCLASS)]
|
||||||
DefWindowProcW = windll.user32.DefWindowProcW
|
# DefWindowProcW
|
||||||
|
# Ref: <https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-defwindowprocw>
|
||||||
|
# LRESULT DefWindowProcW([in] HWND hWnd,[in] UINT Msg,[in] WPARAM wParam,[in] LPARAM lParam);
|
||||||
|
# As per example at <https://docs.python.org/3/library/ctypes.html#ctypes.WINFUNCTYPE>
|
||||||
|
prototype = WINFUNCTYPE(c_long, HWND, UINT, WPARAM, LPARAM)
|
||||||
|
paramflags = (1, "hWnd"), (1, "Msg"), (1, "wParam"), (1, "lParam")
|
||||||
|
DefWindowProcW = prototype(("DefWindowProcW", windll.user32), paramflags)
|
||||||
GetParent = windll.user32.GetParent
|
GetParent = windll.user32.GetParent
|
||||||
SetForegroundWindow = windll.user32.SetForegroundWindow
|
SetForegroundWindow = windll.user32.SetForegroundWindow
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user