First I will like to thank Tim Roberts for his answer about GWL_EXSTYL. I replaced all the hex values with dec values. Now I don't get any error about the handles but I get another error: error:(317,'UpdateLayeredWindow','The system cannot find message text for message number 0x%1 in the message fie for %2.') Please, can you tell me how to properly use the UpdateLayeredWindow? My latest code version is:
import wx import time import win32gui import win32api #for RGB GWL_EXSTYLE = -20 WS_EX_LAYERED = 524288 WS_EX_TRANSPARENT = 32 LWA_ALPHA = 2 LWA_COLORKEY = 1 class MyFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, wx.ID_ANY, title = "Test") hwnd = self.GetHandle() gwl = win32api.GetWindowLong(hwnd, GWL_EXSTYLE) win32gui.SetWindowLong(hwnd, GWL_EXSTYLE, (gwl | WS_EX_LAYERED)) self.bmp = wx.EmptyBitmap(800,600) jpg1 = wx.Image('Multiple alpha.png', wx.BITMAP_TYPE_PNG) self.bmp = jpg1.ConvertToBitmap() w1, h1 = self.bmp.GetWidth(), self.bmp.GetHeight() self.SetClientSize( (w1, h1) ) screenDC = win32gui.GetDC(None) cScreenDC = win32gui.CreateCompatibleDC(screenDC) win32gui.SelectObject(cScreenDC, self.bmp.GetHandle()) p = (50,50) p2 = (0,0) s = (816,612) blend = (0,0,200,1) crkey = win32api.RGB(255,255,0) flags = (LWA_ALPHA | LWA_COLORKEY) print win32gui.UpdateLayeredWindow(hwnd, screenDC, p, s, cScreenDC, p2, crkey, blend, flags) app = wx.App() frame = MyFrame() frame.Show() app.SetTopWindow(frame) app.MainLoop() Thank you very much, Alexandru Ionescu
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32