[python-win32] win32gui and PyHANDLE

Tim Roberts timr at probo.com
Thu Aug 19 19:52:48 CEST 2010

 Alexandru Ionescu wrote:
> Hello,
> In the last two weeks I've been trying to properly use
> UpdateLayeredWindow in Python but I'm only getting errors. I want to
> make a quality window with per pixel alpha graphics. I tried
> with win32gui & win32api and I also tried with ctypes. I got all kinds
> of errors. In the end I got this error:
> /gwl = win32api.GetWindowLong(hwnd, GWL_EXSTYLES)/
> /OverflowError: Python int too large to convert to C long/
> Here is my latest code (made with win32gui & win32api):
> #==================================================================
> import wx
> import win32gui
> import win32api      #for RGB

Although this is a tricky problem in the general case, your solution is
simple.  Just change this to:
    GWL_EXSTYLE = -20
That's a better answer anyway, it matches the C definition, and it works
in the 64-bit case as well.

Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

More information about the python-win32 mailing list