Export to GitHub

pyglet - issue #559

Buggy implementation of _user32.ClientToScreen(self._hwnd, byref(rect))


Posted on Mar 16, 2012 by Swift Kangaroo

What steps will reproduce the problem? 1. simply call Win32Window.GetLocation 2. 3.

Paste in the traceback or error message:

self.window.get_location()

File "C:\Python27\lib\site-packages\pyglet\window\win32__init__.py", line 321, in get_location _user32.ClientToScreen(self._hwnd, byref(rect)) ctypes.ArgumentError: argument 2: <type 'exceptions.TypeError'>: expected LP_POINT instance instead of pointer to RECT

Any additional info (platform/language/hardware) that may be relevant? Here is the fix: rect = RECT() _user32.GetClientRect(self._hwnd, byref(rect)) point = POINT() point.x = rect.left point.y = rect.top _user32.ClientToScreen(self._hwnd, byref(point)) return point.x, point.y

Comment #1

Posted on Jun 10, 2012 by Quick Lion

This has been fixed together with issue 510 in rev. e46762382a3c

Status: Fixed