Solved

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

Posted on 2002-03-17
12
261 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

729 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