[python-win32] Existing App-window ->Transparent

Gavin Brelstaff gjb at crs4.it
Wed Jul 7 20:06:05 CEST 2004


I've been happily using win32gui.EnumWindows()
to get handles of GUI windows existing applications
running on Win2k and WinXP.

I've managed to read the titlebar of various running apps windows.
Now I'd like to change the background color of that window
so that it is transparent - i.e. so I can see through it to
the window underneath it. Is this possible?
I am no guru of MFC,COM etc - so I'd appreciate any existence proofs.

I've tried - without joy - this :

...
	dc = win32ui.CreateDCFromHandle(handle)
	try:
		dc.SetBkMode(win32con.TRANSPARENT)
		dc.RestoreDC()
	except Exception, e:
		print "dc.SetBkMode(win32con.TRANSPARENT) failed", e

But my ignorance of the Windows API


More information about the Python-win32 mailing list