Article View: borland.public.cppbuilder.nativeapi
Article #10661Re: Painting with Windows...
From: Mark Morrisson
Date: Wed, 07 Apr 2004 09:31
Date: Wed, 07 Apr 2004 09:31
33 lines
2579 bytes
2579 bytes
Hi Ed, Thanks alot for your reply. I hope you're doing right. Well, you said that the outline was part of the non-client area. You're right, it's precisely the reason why I wondered why the outline wasn't drawn when I handled WM_PAINT (thru calls to BeginPaint/EndPaint). I do not handle the WM_NCPAINT message. Ok, I will ask the question differently. What is the difference between BeginPaint/EndPaint and GetDC/ReleaseDC in a WM_PAINT message handler ? In order to repaint the window, I've called InvalidateRect with the 3rd parameter set to TRUE, meaning I want to erase the background. Everything is erased except the static controls' captions, this means that when I change the captions with SetWindowText, the old caption is still behind the new one. I've processed the WM_ERASEBKGND message by returning a non-zero value without success. Anyway, I repeat that static controls are the -only- components that pose a problem. All other components of the group box (lines and rectangles) are erased fine before they are drawn again. Once again, you're right, when you call SetWindowText, Windows should clear the background by itself before showing the new text. But in my application, Windows clearly doesn't ! I have to iconize the window, then open it up again in order to see the labels displayed right. Though, my program doesn't specifically handle this situation, the WM_PAINT is just sent once again to my application. I think it must be due to a bug of Windows. Don't worry, Ed, I'm not a newbie, I always keep win32.hlp at hand. ;-) Have a nice day, Mark
Technical Details
Message-ID:
<4073caac$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!border1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40730473$1@newsgroups.borland.com> <407314f2$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,d9cf3e1d5e3d04cb X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-04-07 02:33:21 PST From: "Mark Morrisson" <mark4@NO_SPAMvoila.fr> Newsgroups: borland.public.cppbuilder.nativeapi References: <40730473$1@newsgroups.borland.com> <407314f2$1@newsgroups.borland.com> Subject: Re: Painting with Windows... Date: Wed, 7 Apr 2004 11:31:08 +0200 Lines: 35 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 212.194.74.94 Message-ID: <4073caac$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1081330348 212.194.74.94 (7 Apr 2004 02:32:28 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!border1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail