🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Painting with Windows...

#10432
From: Mark Morrisson
Date: Thu, 08 Apr 2004 11:29
49 lines
2309 bytes
Well, I don't know what to think about the BeginPaint/EndPaint thing. I've
just carried
out some tests and I really need to call GetDC/ReleaseDC in order to make
the outline
appear. Here is an extract from the code :

LRESULT CALLBACK grpProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
 switch (uMsg)
 {
  case WM_PAINT:
   Grp_OnPaint(hwnd);
   break;
...
 }

 return CallWindowProc(oldGrpProc, hwnd, uMsg, wParam, lParam);
}

void Grp_OnPaint(HWND hwnd)
{
 HDC hdc = GetDC(hwnd);
...
 ReleaseDC(hwnd, hdc);
}

This makes the outline appear but this does not :

void Grp_OnPaint(HWND hwnd)
{
 PAINTSTRUCT ps;

 HDC hdc = BeginPaint(hwnd, &ps);
...
 EndPaint(hwnd, &ps);
}

As for the label superposition, I have discovered something. In fact, I call
UpdateWindow in
response to a click on a trackbar. The latter is child of the group box. But
if I make it child of
the main dialog, then the superposition doesn't happen anymore... It seems
as if Windows had
difficulty in repainting a window when the message comes from a component
that makes a part
of this window and thus needs to be repainted itself... Well, I don't really
understand why.

Mark
Technical Details
Message-ID: <407537db$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> <407314f2$1@newsgroups.borland.com> <4073caac$1@newsgroups.borland.com> <40743f39@newsgroups.borland.com> <40747493$1@newsgroups.borland.com> <407492c0$1@newsgroups.borland.com> <40750aa5@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-08 04:39:22 PST
From: "Mark Morrisson" <mark4@NO_SPAMvoila.fr>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <40730473$1@newsgroups.borland.com> <407314f2$1@newsgroups.borland.com> <4073caac$1@newsgroups.borland.com> <40743f39@newsgroups.borland.com> <40747493$1@newsgroups.borland.com> <407492c0$1@newsgroups.borland.com> <40750aa5@newsgroups.borland.com>
Subject: Re: Painting with Windows...
Date: Thu, 8 Apr 2004 13:29:13 +0200
Lines: 51
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: 62.34.82.72
Message-ID: <407537db$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1081423835 62.34.82.72 (8 Apr 2004 04:30:35 -0800)
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