Opacity and WM_NCCALCSIZE

G

Guest

I have a form which has a custom Non-client area. When the note is activated
the NC area is inflated, keeping the client area at the same location on the
screen. I manage the size of the NC area using the WM_NCCALCSIZE message and
paint it during the WM_NCPAINT. All works well as long as I do not set the
opacity on the window. Setting the opacity to anything other than 1 causes
all sorts of problems. For example, the DC returned by GetWindowDC is not
aligned with the actual location of the window so the window is drawn in an
incorrect location (it's offest by the width and height of the NC border),
the drawing area in the DC is the wrong size so I cannot paint the entire NC
area, the client area is not correctly positioned and the mouse hit testing
is incorrect. In general things are a mess when opacity is set to anything
other than 1.

Any thoughts or comments?
 
A

Andrew Baker

I have had exactly the same problem, couldn't understand what was
going on. Even tried reseting the clipping - did you ever get to the
bottom of this or come up with a work around?

thanks
andrew
 
G

Guest

No workaround, I have read where some video adapters have trouble
implementing transparency, however, this problem has shown up on every
machine I've tested and I've heard of this from others in various forums.

I have a simple application which demonstrates the problem. I did this to
convince myself that it was indeed an system problem and not a problem with
other parts of my code. Perhaps the next step is to submit a bug report to
MS.

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top