Dear Tim:

by the way, quick question, do you know of a way to "get" the extended style bits? I haven't been able to find anything on MSDN. In other words, if I do as you suggest below for a few windows, how can I query those windows again to see if those bits that I previously set using SetWindowLong() are indeed set?

Thanks!

On 12/28/2010 1:44 PM, Tim Roberts wrote:
Reckoner wrote:
Using Python win32 extensions, how do you make an arbitrary window on
winXP transparent?

I'll assume you already know how to find the window handle of your
victim window.

The key concept is that you need to set the WS_EX_LAYERED bit in the
extended styles, then set the transparency level using
SetLayeredWindowAttributes.  You can look up both APIs in MSDN for more
detailed information.

     import win32gui
     import win32con
     win32gui.SetWindowLong(handle, win32con.GWL_EXSTYLE,
win32con.WS_EX_LAYERED)
     win32gui.SetLayeredWindowAttributes(handle, 0, 128, win32con.LWA_ALPHA)

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to