Article View: borland.public.cppbuilder.nativeapi
Article #42Re: Some HDC questions
From: UO
Date: Wed, 06 Aug 2008 07:36
Date: Wed, 06 Aug 2008 07:36
43 lines
2134 bytes
2134 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com>, haber iletisinde �unlar�
yazd�:4898bd3c$1@newsgroups.borland.com...
>
> "UO" <uo@uott> wrote in message news:4898a6fd$1@newsgroups.borland.com...
>
>> Sorry, my mistake. The code should be:
>
> Your code is still not looking at the wParam value. And it is passing an
> invalid HWND to both BeginPaint() and EndPaint() as well. Try this
> instead:
>
> case WM_PAINT:
> if( wParam == 0 )
> hdc = BeginPaint(hwnd, &ps);
>
> else
> hdc = reinterpret_cast<HDC>(wParam);
> ...
> if( wParam == 0 )
> EndPaint(hwnd, &ps);
> break;
>
>
> Gambit
Sorry, I've made a typing mistake again. It should:
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
hBrushOld = SelectObject(hdc, hBrush);
GetClientRect(&rect);
Rectangle(hdc, 10, 20, 30, 40);
SelectObject(hdc, hBrushOld); //1
EndPaint(hwnd, &ps);
break;
(But appearently you understood what I meant)
I'm not using common controls currently.
Anyway, should I use a ReleaseDC() or something after
"hdc = reinterpret_cast<HDC>(wParam);" ?
UO
Technical Details
Message-ID:
<48995465$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder.news-service.com!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<489877b5$1@newsgroups.borland.com> <489892df$1@newsgroups.borland.com> <4898a6fd$1@newsgroups.borland.com> <4898bd3c$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fa1b3304c969ec75 X-Google-Attributes: gid10cc67,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII From: "UO" <uo@uott> Newsgroups: borland.public.cppbuilder.nativeapi References: <489877b5$1@newsgroups.borland.com> <489892df$1@newsgroups.borland.com> <4898a6fd$1@newsgroups.borland.com> <4898bd3c$1@newsgroups.borland.com> Subject: Re: Some HDC questions Date: Wed, 6 Aug 2008 10:36:08 +0300 Lines: 45 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 81.213.76.81 Message-ID: <48995465$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1218008165 81.213.76.81 (6 Aug 2008 00:36:05 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder.news-service.com!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail