(hWndFrom, hWndTo, lpPoints)
| 1309 | # __in UINT cPoints |
| 1310 | # ); |
| 1311 | def MapWindowPoints(hWndFrom, hWndTo, lpPoints): |
| 1312 | _MapWindowPoints = windll.user32.MapWindowPoints |
| 1313 | _MapWindowPoints.argtypes = [HWND, HWND, LPPOINT, UINT] |
| 1314 | _MapWindowPoints.restype = ctypes.c_int |
| 1315 | |
| 1316 | cPoints = len(lpPoints) |
| 1317 | lpPoints = (POINT * cPoints)(*lpPoints) |
| 1318 | SetLastError(ERROR_SUCCESS) |
| 1319 | number = _MapWindowPoints(hWndFrom, hWndTo, byref(lpPoints), cPoints) |
| 1320 | if number == 0: |
| 1321 | errcode = GetLastError() |
| 1322 | if errcode != ERROR_SUCCESS: |
| 1323 | raise ctypes.WinError(errcode) |
| 1324 | x_delta = number & 0xFFFF |
| 1325 | y_delta = (number >> 16) & 0xFFFF |
| 1326 | return x_delta, y_delta, [(Point.x, Point.y) for Point in lpPoints] |
| 1327 | |
| 1328 | |
| 1329 | # BOOL SetForegroundWindow( |
no test coverage detected