Solved

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

Posted on 2002-03-17
12
253 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:mathiasf
  • 6
  • 4
12 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 6875922
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
 

Author Comment

by:mathiasf
ID: 6875939
The application is going to run on different window plattforms not just win 2k. So I kneed another way to do this
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 6875944
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
 

Author Comment

by:mathiasf
ID: 6875975
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
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 6875978
Yes,

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

Roshmon
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:mathiasf
ID: 6875998
Show me how then, can u give me some code samples?
0
 

Author Comment

by:mathiasf
ID: 6876004
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
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 150 total points
ID: 6876008
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
 

Author Comment

by:mathiasf
ID: 6876028
Ok .. give some code that makes it work then .. because I can't make it work
0
 
LVL 49

Assisted Solution

by:DanRollins
DanRollins earned 150 total points
ID: 6878767
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
 

Author Comment

by:mathiasf
ID: 6878821
I only seem to get it transparent when I rezise the window.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 55
Windows Drag & Drop Location 2 94
xyBalance chalenge 58 88
Problem to event 3 78
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now