Article View: borland.public.cppbuilder.nativeapi
Article #16502Re: Problem with window subclassing...
From: Mark Morrisson
Date: Sun, 11 May 2003 17:06
Date: Sun, 11 May 2003 17:06
24 lines
2107 bytes
2107 bytes
Hi Gary ! I hope you're doing fine. Well, I gave you all the pieces of code that do the subclassing along my previous posts. The subclassing does work, I have set up a debug point inside the new WM_PAINT handler. And I can -assure- you that WM_PAINT isn't called when SetWindowText is called, only WM_SETTEXT is called. The default handler of WM_SETTEXT stores the text in an internal buffer, and displays it (that's why you can call SetWindowText at any moment). If I don't intercept WM_SETTEXT, then Windows displays the text, and when my WM_PAINT handler is called, it writes over the previous displayed text. Since I reduced the font, I can still see the text displayed by Windows behind my new text. Look at Win32.hlp, it says that SetWindowText stores the text and a buffer AND display it, without calling WM_PAINT. Your idea to use the hMenu parameter in CreateWindow is pretty good, I hadn't thought of it. But I guess that subclassing is a bit "cleaner", don't you think ? Have a nice day, Mark
Technical Details
Message-ID:
<3ebe828b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3ebb5ec5$1@newsgroups.borland.com> <3ebb9f7b$1@newsgroups.borland.com> <3ebbd08b@newsgroups.borland.com> <3ebcfa09@newsgroups.borland.com> <3ebd2733@newsgroups.borland.com> <3ebe58ee@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,2ec9c93be1540300 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-11 10:05:56 PST From: "Mark Morrisson" <mark4@NO_SPAMvoila.fr> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ebb5ec5$1@newsgroups.borland.com> <3ebb9f7b$1@newsgroups.borland.com> <3ebbd08b@newsgroups.borland.com> <3ebcfa09@newsgroups.borland.com> <3ebd2733@newsgroups.borland.com> <3ebe58ee@newsgroups.borland.com> Subject: Re: Problem with window subclassing... Date: Sun, 11 May 2003 19:06:47 +0200 Lines: 26 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 212.194.58.85 Message-ID: <3ebe828b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1052672651 212.194.58.85 (11 May 2003 10:04:11 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail