Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2005

Tip: Looking for answers? Try searching our database.

Opacity and WM_NCCALCSIZE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian Westover - 09 Feb 2005 17:51 GMT
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?

Signature

Brian

Andrew Baker - 16 Feb 2005 15:03 GMT
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

"=?Utf-8?B?QnJpYW4gV2VzdG92ZXI=?=" <BrianWestover@discussions.microsoft.com> wrote in message news:<10637567-9F4E-4A24-88F0-ED8E2ABB733B@microsoft.com>...
> 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
[quoted text clipped - 10 lines]
>
> Any thoughts or comments?
Brian Westover - 21 Feb 2005 22:41 GMT
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

> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.