autoxkit 2.4.8__tar.gz → 2.4.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {autoxkit-2.4.8 → autoxkit-2.4.9}/PKG-INFO +1 -1
  2. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/window/window.py +26 -0
  3. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/window/window_action.py +9 -0
  4. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/window/window_match.py +36 -0
  5. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit.egg-info/PKG-INFO +1 -1
  6. {autoxkit-2.4.8 → autoxkit-2.4.9}/pyproject.toml +1 -1
  7. {autoxkit-2.4.8 → autoxkit-2.4.9}/LICENSE.txt +0 -0
  8. {autoxkit-2.4.8 → autoxkit-2.4.9}/README.md +0 -0
  9. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/__init__.py +0 -0
  10. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/android/__init__.py +0 -0
  11. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/android/adb.py +0 -0
  12. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/android/binary.py +0 -0
  13. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/android/client.py +0 -0
  14. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/android/control.py +0 -0
  15. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/android/control_backup.py +0 -0
  16. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/android/models.py +0 -0
  17. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/android/streams.py +0 -0
  18. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/constants.py +0 -0
  19. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/hook/__init__.py +0 -0
  20. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/hook/event.py +0 -0
  21. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/hook/hook_listener.py +0 -0
  22. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/hook/hotkey_listener.py +0 -0
  23. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/match/__init__.py +0 -0
  24. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/match/match.py +0 -0
  25. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/mousekey/__init__.py +0 -0
  26. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/mousekey/input.py +0 -0
  27. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/mousekey/keyboard.py +0 -0
  28. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/mousekey/mouse.py +0 -0
  29. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/utils.py +0 -0
  30. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit/window/__init__.py +0 -0
  31. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit.egg-info/SOURCES.txt +0 -0
  32. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit.egg-info/dependency_links.txt +0 -0
  33. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit.egg-info/requires.txt +0 -0
  34. {autoxkit-2.4.8 → autoxkit-2.4.9}/autoxkit.egg-info/top_level.txt +0 -0
  35. {autoxkit-2.4.8 → autoxkit-2.4.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autoxkit
3
- Version: 2.4.8
3
+ Version: 2.4.9
4
4
  Summary: Python library for Windows automation and Android device screen casting and control
5
5
  Author-email: YorickFin <1582456060@qq.com>
6
6
  License: GPL-3.0-or-later
@@ -10,6 +10,32 @@ user32 = ctypes.windll.user32
10
10
  # 定义回调函数类型
11
11
  EnumWindowsProc = ctypes.WINFUNCTYPE(wintypes.BOOL, wintypes.HWND, wintypes.LPARAM)
12
12
 
13
+ # 显式声明 API 签名:64 位系统下 HWND 是 64 位句柄,
14
+ # 不声明时 ctypes 默认按 c_int(32位) 转换,句柄值过大会抛
15
+ # OverflowError: int too long to convert;返回值不声明 restype 也会被截断
16
+ user32.IsWindow.argtypes = [wintypes.HWND]
17
+ user32.IsWindow.restype = wintypes.BOOL
18
+ user32.GetParent.argtypes = [wintypes.HWND]
19
+ user32.GetParent.restype = wintypes.HWND
20
+ user32.ShowWindow.argtypes = [wintypes.HWND, ctypes.c_int]
21
+ user32.ShowWindow.restype = wintypes.BOOL
22
+ user32.EnumWindows.argtypes = [EnumWindowsProc, wintypes.LPARAM]
23
+ user32.EnumWindows.restype = wintypes.BOOL
24
+ user32.EnumChildWindows.argtypes = [wintypes.HWND, EnumWindowsProc, wintypes.LPARAM]
25
+ user32.EnumChildWindows.restype = wintypes.BOOL
26
+ user32.GetWindowTextLengthW.argtypes = [wintypes.HWND]
27
+ user32.GetWindowTextLengthW.restype = ctypes.c_int
28
+ user32.GetWindowTextW.argtypes = [wintypes.HWND, wintypes.LPWSTR, ctypes.c_int]
29
+ user32.GetWindowTextW.restype = ctypes.c_int
30
+ user32.GetClassNameW.argtypes = [wintypes.HWND, wintypes.LPWSTR, ctypes.c_int]
31
+ user32.GetClassNameW.restype = ctypes.c_int
32
+ user32.GetClientRect.argtypes = [wintypes.HWND, ctypes.POINTER(RECT)]
33
+ user32.GetClientRect.restype = wintypes.BOOL
34
+ user32.GetWindowRect.argtypes = [wintypes.HWND, ctypes.POINTER(RECT)]
35
+ user32.GetWindowRect.restype = wintypes.BOOL
36
+ user32.ClientToScreen.argtypes = [wintypes.HWND, ctypes.POINTER(wintypes.POINT)]
37
+ user32.ClientToScreen.restype = wintypes.BOOL
38
+
13
39
 
14
40
  class Window(WindowAction, WindowMatch):
15
41
 
@@ -24,6 +24,15 @@ GetWindowRect = user32.GetWindowRect
24
24
  GetWindowRect.argtypes = [wintypes.HWND, ctypes.POINTER(wintypes.RECT)]
25
25
  GetWindowRect.restype = wintypes.BOOL
26
26
 
27
+ # 客户区坐标转换 / 客户区矩形(64 位 HWND 需显式声明,否则句柄值过大会溢出)
28
+ ClientToScreen = user32.ClientToScreen
29
+ ClientToScreen.argtypes = [wintypes.HWND, ctypes.POINTER(wintypes.POINT)]
30
+ ClientToScreen.restype = wintypes.BOOL
31
+
32
+ GetClientRect = user32.GetClientRect
33
+ GetClientRect.argtypes = [wintypes.HWND, ctypes.POINTER(wintypes.RECT)]
34
+ GetClientRect.restype = wintypes.BOOL
35
+
27
36
  # 定义窗口消息常量
28
37
  WM_KEYDOWN = 0x0100
29
38
  WM_KEYUP = 0x0101
@@ -30,6 +30,42 @@ class BITMAPINFO(ctypes.Structure):
30
30
  ("bmiColors", wintypes.DWORD * 3)
31
31
  ]
32
32
 
33
+ user32 = ctypes.windll.user32
34
+ gdi32 = ctypes.windll.gdi32
35
+
36
+ # 显式声明 API 签名:64 位系统下 HWND/HDC/HBITMAP 均为 64 位句柄,
37
+ # 不声明 argtypes 时入参按 c_int(32位) 转换会溢出(OverflowError),
38
+ # 不声明 restype 时返回的句柄会被截断,导致截图等功能静默失败
39
+ user32.GetDC.argtypes = [wintypes.HWND]
40
+ user32.GetDC.restype = wintypes.HDC
41
+ user32.ReleaseDC.argtypes = [wintypes.HWND, wintypes.HDC]
42
+ user32.ReleaseDC.restype = ctypes.c_int
43
+ user32.GetClientRect.argtypes = [wintypes.HWND, ctypes.POINTER(RECT)]
44
+ user32.GetClientRect.restype = wintypes.BOOL
45
+ user32.GetWindowRect.argtypes = [wintypes.HWND, ctypes.POINTER(RECT)]
46
+ user32.GetWindowRect.restype = wintypes.BOOL
47
+ user32.ClientToScreen.argtypes = [wintypes.HWND, ctypes.POINTER(wintypes.POINT)]
48
+ user32.ClientToScreen.restype = wintypes.BOOL
49
+ user32.PrintWindow.argtypes = [wintypes.HWND, wintypes.HDC, wintypes.UINT]
50
+ user32.PrintWindow.restype = wintypes.BOOL
51
+
52
+ gdi32.CreateCompatibleDC.argtypes = [wintypes.HDC]
53
+ gdi32.CreateCompatibleDC.restype = wintypes.HDC
54
+ gdi32.CreateCompatibleBitmap.argtypes = [wintypes.HDC, ctypes.c_int, ctypes.c_int]
55
+ gdi32.CreateCompatibleBitmap.restype = wintypes.HBITMAP
56
+ gdi32.SelectObject.argtypes = [wintypes.HDC, wintypes.HGDIOBJ]
57
+ gdi32.SelectObject.restype = wintypes.HGDIOBJ
58
+ gdi32.BitBlt.argtypes = [wintypes.HDC, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int,
59
+ wintypes.HDC, ctypes.c_int, ctypes.c_int, wintypes.DWORD]
60
+ gdi32.BitBlt.restype = wintypes.BOOL
61
+ gdi32.GetDIBits.argtypes = [wintypes.HDC, wintypes.HBITMAP, wintypes.UINT, wintypes.UINT,
62
+ ctypes.c_void_p, ctypes.c_void_p, wintypes.UINT]
63
+ gdi32.GetDIBits.restype = ctypes.c_int
64
+ gdi32.DeleteObject.argtypes = [wintypes.HGDIOBJ]
65
+ gdi32.DeleteObject.restype = wintypes.BOOL
66
+ gdi32.DeleteDC.argtypes = [wintypes.HDC]
67
+ gdi32.DeleteDC.restype = wintypes.BOOL
68
+
33
69
  class WindowMatch:
34
70
  """窗口匹配类"""
35
71
  def __init__(self, hwnd: int = None):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autoxkit
3
- Version: 2.4.8
3
+ Version: 2.4.9
4
4
  Summary: Python library for Windows automation and Android device screen casting and control
5
5
  Author-email: YorickFin <1582456060@qq.com>
6
6
  License: GPL-3.0-or-later
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "autoxkit"
7
- version = "2.4.8"
7
+ version = "2.4.9"
8
8
  description = "Python library for Windows automation and Android device screen casting and control"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes