?
Solved

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

Posted on 2002-03-17
12
Medium Priority
?
267 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
Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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…
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…
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.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

765 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