Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2002-03-17
12
Medium Priority
?
270 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 300 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 300 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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

618 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