Skip to content

Commit

Permalink
Apply the same principle (wintypes.POINT) to POINT
Browse files Browse the repository at this point in the history
  • Loading branch information
CristiFati committed May 18, 2019
1 parent 85009fe commit dfa675c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
12 changes: 6 additions & 6 deletions pywinauto/win32functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -310,7 +310,7 @@
MenuItemFromPoint.argtypes = [
wintypes.HWND,
wintypes.HMENU,
POINTER(win32structures.POINT),
POINTER(wintypes.POINT),
]
BringWindowToTop = windll.user32.BringWindowToTop
BringWindowToTop.restype = wintypes.BOOL
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 3 additions & 7 deletions pywinauto/win32structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down

0 comments on commit dfa675c

Please sign in to comment.