How do I make my client windows transparent in my MDI application?

Hi.

I would like the background in my CView windows in my MDI app to be transparent so that I can put them over each other in order to compare charts etc. How do I achive this functionallity?

Thanks for any help.
mathiasfAsked:
Who is Participating?
 
Roshan DavisCommented:
The use

WS_EX_TRANSPARENT   Specifies that a window created with this style is to be transparent. That is, any windows that are beneath the window are not obscured by the window. A window created with this style receives WM_PAINT messages only after all sibling windows beneath it have been updated.


Roshmon
0
 
Roshan DavisCommented:
If u are using Win 2000 , u can use WS_EX_LAYERED ( 0x00080000 ) style for the window, and can apply transparency ratio by SetLayeredWindowAttributes function..

GOOD LUCK
0
 
mathiasfAuthor Commented:
The application is going to run on different window plattforms not just win 2k. So I kneed another way to do this
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
Roshan DavisCommented:
Try to use WS_EX_TRANSPARENT

Or u can simulate transparency by keeping background dc in a memory dc, and draw it on the View DC

GOOD LUCK
0
 
mathiasfAuthor Commented:
I would like to just make the client area transparent not the whole window. I kneed a standard method to do this.

But thanks anyway.
0
 
Roshan DavisCommented:
Yes,

Using my prev. comment, u can do this...

Roshmon
0
 
mathiasfAuthor Commented:
Show me how then, can u give me some code samples?
0
 
mathiasfAuthor Commented:
Yes by keeping the background DC in memory no problem there. But the you have to keep track of any changes of the main window and it's clients windows. Is this a nice way to do it?
0
 
mathiasfAuthor Commented:
Ok .. give some code that makes it work then .. because I can't make it work
0
 
DanRollinsCommented:
I think you may also need to override WM_ERASEBKGD to prevent the 'front' window from clearing out the images from the bac window(s).
0
 
mathiasfAuthor Commented:
I only seem to get it transparent when I rezise the window.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.