Skip to content

Commit ff7f513

Browse files
committed
fix: Python 绑定 Win32Hwnd 类型错误
1 parent f04cb8a commit ff7f513

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

source/binding/Python/maa/library.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,11 @@ class _Toolkit:
346346
@staticmethod
347347
def MaaToolkitFindWindow(
348348
class_name: MaaStringView, window_name: MaaStringView
349-
) -> MaaWin32Hwnd: ...
349+
) -> MaaSize: ...
350350
@staticmethod
351351
def MaaToolkitSearchWindow(
352352
class_name: MaaStringView, window_name: MaaStringView
353-
) -> MaaWin32Hwnd: ...
353+
) -> MaaSize: ...
354354
@staticmethod
355355
def MaaToolkitGetWindow(index: MaaSize) -> MaaWin32Hwnd: ...
356356
@staticmethod

source/binding/Python/maa/toolkit.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ def register_action_exec_agent(
9494
# TODO: 进一步封装 Win32Hwnd 系列函数?
9595

9696
@classmethod
97-
def find_window(cls, class_name: str, window_name: str) -> MaaWin32Hwnd:
97+
def find_window(cls, class_name: str, window_name: str) -> MaaSize:
9898
cls._set_api_properties()
9999

100100
return Library.toolkit.MaaToolkitFindWindow(
101101
class_name.encode("utf-8"), window_name.encode("utf-8")
102102
)
103103

104104
@classmethod
105-
def search_window(cls, class_name: str, window_name: str) -> MaaWin32Hwnd:
105+
def search_window(cls, class_name: str, window_name: str) -> MaaSize:
106106
cls._set_api_properties()
107107

108108
return Library.toolkit.MaaToolkitSearchWindow(
@@ -201,13 +201,13 @@ def _set_api_properties():
201201
MaaStringView,
202202
]
203203

204-
Library.toolkit.MaaToolkitFindWindow.restype = MaaWin32Hwnd
204+
Library.toolkit.MaaToolkitFindWindow.restype = MaaSize
205205
Library.toolkit.MaaToolkitFindWindow.argtypes = [
206206
MaaStringView,
207207
MaaStringView,
208208
]
209209

210-
Library.toolkit.MaaToolkitSearchWindow.restype = MaaWin32Hwnd
210+
Library.toolkit.MaaToolkitSearchWindow.restype = MaaSize
211211
Library.toolkit.MaaToolkitSearchWindow.argtypes = [
212212
MaaStringView,
213213
MaaStringView,

0 commit comments

Comments
 (0)