From dfa675c4fcfcb7b62a656f3d69dda60e007bffcc Mon Sep 17 00:00:00 2001 From: CristiFati Date: Wed, 15 May 2019 16:37:56 +0300 Subject: [PATCH] Apply the same principle (wintypes.POINT) to POINT --- pywinauto/win32functions.py | 12 ++++++------ pywinauto/win32structures.py | 10 +++------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/pywinauto/win32functions.py b/pywinauto/win32functions.py index 3deb77c6d..c7ac31786 100644 --- a/pywinauto/win32functions.py +++ b/pywinauto/win32functions.py @@ -184,12 +184,12 @@ GetCursorPos = windll.user32.GetCursorPos GetCursorPos.restype = wintypes.BOOL GetCursorPos.argtypes = [ - POINTER(win32structures.POINT), + POINTER(wintypes.POINT), ] GetCaretPos = windll.user32.GetCaretPos GetCaretPos.restype = wintypes.BOOL GetCaretPos.argtypes = [ - POINTER(win32structures.POINT), + POINTER(wintypes.POINT), ] GetKeyboardState = windll.user32.GetKeyboardState GetKeyboardState.restype = wintypes.BOOL @@ -310,7 +310,7 @@ MenuItemFromPoint.argtypes = [ wintypes.HWND, wintypes.HMENU, - POINTER(win32structures.POINT), + POINTER(wintypes.POINT), ] BringWindowToTop = windll.user32.BringWindowToTop BringWindowToTop.restype = wintypes.BOOL @@ -413,13 +413,13 @@ ClientToScreen.restype = wintypes.BOOL ClientToScreen.argtypes = [ wintypes.HWND, - POINTER(win32structures.POINT), + POINTER(wintypes.POINT), ] ScreenToClient = windll.user32.ScreenToClient ScreenToClient.restype = wintypes.BOOL ScreenToClient.argtypes = [ wintypes.HWND, - POINTER(win32structures.POINT), + POINTER(wintypes.POINT), ] GetCurrentThreadId = windll.kernel32.GetCurrentThreadId GetCurrentThreadId.restype = wintypes.DWORD @@ -624,7 +624,7 @@ WindowFromPoint = windll.user32.WindowFromPoint WindowFromPoint.restype = wintypes.HWND WindowFromPoint.argtypes = [ - win32structures.POINT, + wintypes.POINT, ] WaitForSingleObject = windll.kernel32.WaitForSingleObject WaitForSingleObject.restype = wintypes.DWORD diff --git a/pywinauto/win32structures.py b/pywinauto/win32structures.py index d808fc5d9..ce8867ab1 100644 --- a/pywinauto/win32structures.py +++ b/pywinauto/win32structures.py @@ -153,13 +153,9 @@ def _reduce(self): WPARAM = wintypes.WPARAM -class POINT(Structure): - _pack_ = 4 - _fields_ = [ - # C:/PROGRA~1/MIAF9D~1/VC98/Include/windef.h 307 - ('x', LONG), - ('y', LONG), - ] +class POINT(wintypes.POINT): + + """Wrap the POINT structure and add extra functionality""" def __iter__(self): """Allow iteration through coordinates"""