Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transparent Windows in Win9x

Status
Not open for further replies.

martindb

Programmer
Apr 16, 2003
2
BG
I need to make a transparent window just like those in Windows 2000/XP, but it should be working on Windows 98. Can anyone give me an idea how this can be achieved.

My initial idea was to override the drawing of a dialog window in such a way that, when it needs repainting, all painting to occur in a memory device context instead of the default screen dc, which afterwards to be BitBlt-ed to screen using a transparency technique. But there appeared serious problems which I still can't find solutions for. What I tried so far is: Made a new dialog and overrode WM_PAINT, WM_NCPAINT and WM_ERASEBACKGROUND to prevent it from drawing on screen. The outcome was the following:

1. Although WM_NCPAINT does nothing (simply returns), the title bar still redraws when I press the taskbar button of the application.
2. Even when I call ValidateRect in WM_PAINT, the controls contained into the dialog still do redraw from time to time (e.g. when moving the window).

And more questions are arising even if this worked fine (e.g. nothing ever was drawn to screen):
- how can I make all child controls paint themselves to a specified dc;
- how can I intercept and process repainting messages for the child controls (e.g. editing in an EditBox, selecting a button and so on)

10x in advance and looking forward to receiving advises!
 
* Transparent should be read either AlphaBlended or Semi-transparent
 
>> how can I make all child controls paint themselves to a
>> specified dc

That's not how it works. Each "window" has it's own DC for painting.

>> how can I intercept and process repainting messages for
>> the child controls

Subclass the control.

-pete

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top