🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Length of text in MessageBox function

#3989
From: Remy Lebeau (TeamB)
Date: Wed, 29 Mar 2006 20:53
27 lines
2132 bytes
"Richard Casten" <richard.casten@aero.org> wrote in message
news:442ADEA7.B11F561C@aero.org...

> I am calling the SetWindowsHookEx function with idHook parameter
> equal to WH_CALLWNDPROC right before I call MessageBox.

I would not suggest using that particular hook type for this
situation.WH_CBT would be more appropriate.

> In the hook function, I test for the window having class name "Static".
> I am then trying to use the DrawText function inside the hook function
> to draw a string.

I would not recommend that approach at all.  Especially since you are not
filtering the messages at all, so you are re-drawing on every possible
message that the window receives.

A better approach would be to resize both the "Dialog" itself and the
"Static" window when it is created to accomodate the added size of your
asterik.  Then use SetWindowLong() to subclass the "Static" window's message
procedure (or use a second hook) to do your asterik drawing only when the
WM_PAINT message is actually received, after passing the WM_PAINT message to
the default handler.


Gambit
Technical Details
Message-ID: <442af3e1$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4422D533.32E31292@aero.org> <4422ea15$1@newsgroups.borland.com> <4422FA56.83B7F39@aero.org> <442319ab@newsgroups.borland.com> <442ADEA7.B11F561C@aero.org>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,b8d4aea1a094904b
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4422D533.32E31292@aero.org> <4422ea15$1@newsgroups.borland.com> <4422FA56.83B7F39@aero.org> <442319ab@newsgroups.borland.com> <442ADEA7.B11F561C@aero.org>
Subject: Re: Length of text in MessageBox function
Date: Wed, 29 Mar 2006 12:53:47 -0800
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <442af3e1$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1143665633 68.69.17.41 (29 Mar 2006 12:53:53 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail