CompuServe Thread

Transparent Windows

3 messages in this thread
#30281From: David PhippsJul 8, 1994 10:17 AM
Hello, everybody! I am trying to solve a couple of nasty problems associated with transparent windows. That's right, TRANSPARENT. Using CWnd::CreateEx(), you can create a window with the TRANSPARENT style bit set – and indeed, it is transparent. Any painting you do on the DC obscures what's below; all else shows through. The problem is on the create, the backgroudn wipes white, and I cannot seem to get the background to repaint and let the underlying areas shine through. I have tried everything – the one thing I have not tried is sending an invalidate to the transparent child window immediately after the create and sitting in a message loop until it finishes. I have tries Invalidate() followed by UpdateWindow(), but of course, this does not work after the create – several messages are stacked up that need to be processed before the window even really exists yet, so these calls are ignored. Any suggestions? Thanks, David Phipps Senior Technical Lead Milagro Systems, Inc.
#30404From: Poon T. FungJul 10, 1994 3:56 AM
David, I am not sure I understand what your problem is. But I think you have problem getting a WS_EX_TRANSPARENT window transparent. If this is the case, you may override OnEraseBkgnd() in your transparent window. Do not do anything, just return TRUE. This tells window you have already taken care of erasing the background and do nothing further. I hope this helps! p.f.
#30528From: David PhippsJul 11, 1994 1:04 PM
Yes! Thanks.