Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an MDI project, using CFormView. I display a bitmap in the form, put CStatic controls on top. I override OnCtlColor to use a hollow brush for the controls so that the bitmap shows through the controls' rectangle and the text is shown on top of the bitmap. For reasons too long to detail here, I moved the controls to a CWnd derived class (the famous CMDIClientWnd subclassed in CMainFrame). However, now the backgrounds of the CStatic controls are not the bitmap but whatever happened to be on the monitor under the application. Anyone know why, and how I can make the bitmap be the background of the controls again? Thanks.
Posted

I've never done this but one thing worth investigating might be to see if SetLayeredWindowAttributes can do the job for you. You'd first need to call SetWindowLong on your controls to turn the WS_EX_LAYERED flag on though. This should make the window transparent so that stuff underneath it shows through.
 
Share this answer
 
I added those 2 calls, unfortunately it didn't help. But thanks for the ideas.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900