🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #10645

Re: Painting with Windows...

#10645
From: Ed Mulroy [TeamB]
Date: Tue, 06 Apr 2004 20:36
36 lines
2326 bytes
> ...if I call BeginPaint/EndPaint, then Windows doesn't draw
> the outline of the group box. Could you explain me why ? ...

The outline is part of the non-client area, the area which is painted
when the window procedure receives the WM_NCPAINT message.

> ... For instance, "hello" then "bye" becomes "byelo"...

The background was erased under the "bye" because the text mode is not
TRANSPARENT.  You did not write to the area with "lo" so it was not
erase.

The background is erased in response to the WM_ERASEBKGND message.  If
you process that message then you should return a non-zero value in
response to it.  For static controls that message might not be
generated.  You can erase the background yourself in the WM_PAINT
handling code

  RECT r;
  GetClientRect(hwnd, &r);
  FillRect(ps.hdc, &r, (HBRUSH) (COLOR_WINDOW + 1));
  // where ps is the PAINTSTRUCT used with BeginPaint

If left to itself and not subclassed or superclassed a static control
should not need to be painted in a WM_PAINT message.  It is sufficient
to do a SetWindowText for it.  Windows will handle the painting and
background clearing.

You would probably benefit from a book on how Windows works.  If you
don't know of any then look around for one of Petzold's Programming
Windows * books.

.  Ed

> Mark Morrisson wrote in message
> news:40730473$1@newsgroups.borland.com...
Technical Details
Message-ID: <407314f2$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40730473$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-06 13:40:05 PST
From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <40730473$1@newsgroups.borland.com>
Subject: Re: Painting with Windows...
Date: Tue, 6 Apr 2004 16:36:23 -0400
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 24.74.175.102
Message-ID: <407314f2$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1081283826 24.74.175.102 (6 Apr 2004 13:37:06 -0800)
X-Authenticated-User: edmulroy
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail