Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 275
  • Last Modified:

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

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
mathiasf
Asked:
mathiasf
  • 6
  • 4
2 Solutions
 
Roshan DavisCommented:
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
 
mathiasfAuthor Commented:
The application is going to run on different window plattforms not just win 2k. So I kneed another way to do this
0
 
Roshan DavisCommented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
mathiasfAuthor Commented:
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
 
Roshan DavisCommented:
Yes,

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

Roshmon
0
 
mathiasfAuthor Commented:
Show me how then, can u give me some code samples?
0
 
mathiasfAuthor Commented:
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
 
Roshan DavisCommented:
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
 
mathiasfAuthor Commented:
Ok .. give some code that makes it work then .. because I can't make it work
0
 
DanRollinsCommented:
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
 
mathiasfAuthor Commented:
I only seem to get it transparent when I rezise the window.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now