Solved

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

Posted on 2002-03-17
12
252 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Strange date stored 22 100
viewing source code from eclipse 13 74
countEvens challenge 2 59
wait notify demo infinite loop 3 81
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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 video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

9 Experts available now in Live!

Get 1:1 Help Now