Article View: borland.public.cppbuilder.nativeapi
Article #12747Re: Tooltips - TTN_SHOW return value
From: Remy Lebeau (TeamB)
Date: Wed, 19 Nov 2003 22:04
Date: Wed, 19 Nov 2003 22:04
45 lines
2743 bytes
2743 bytes
"Marc" <remove_bukwheat@axess.com> wrote in message
news:3fbbe0a2$1@newsgroups.borland.com...
> My question is "What return value???" this is a notification
> message, there is no return value.
Yes, there is:
WM_NOTIFY
...
Return Values
The return value is ignored except for notification messages that
specify otherwise.
TTN_SHOW specifies otherwise, because it needs to know whether the tooltip
has to be positioned automatically or if the application is controlling
that. If you use Spy++ or other similar tool, you will see that WM_NOTIFY
is sent via SendMessage(), not PostMessage(). Messages sent with
SendMessage() always have a return value , even if just the default of 0.
So yes, WM_NOTIFY (and TTN_SHOW in particular) expects a return value, just
as the documentation says.
> How do I use this message correctly to be able to move my window.
A WH_CALLWNDPROC hook is not allowed to alter messages, let alone be able to
return values for them. The only thing your hook procedure can return is
the result of the hook itself, not the message it processes.
WH_CALLWNDPROCRET, on the other hand, has access to the return value of the
message, however WH_CALLWNDPROCRET hooks aren't allows to modify the message
data, either.
> I have managed to hack a solution but I have a small glitch.
> On the WM_WINDOWPOSCHANGING message I verify
> if its a tooltip and if its not at postion 0,0 and the call a
> SetWindowPos with the new location. This displays the TT in
> the new location properly but it first flashes it where it initially
> was suppose to be. Yes this works but the flash is annoying.
There are several other messages that you can try using instead of
WM_WINDOWPOSCHANGING, such as WM_CREATE, WM_NCCALCSIZE, WM_GETMINMAXINFO,
WM_SHOWWINDOW, etc.
Gambit
Technical Details
Message-ID:
<3fbbe7f4$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fbbe0a2$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,82bceac0287af760 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-11-19 14:10:12 PST From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3fbbe0a2$1@newsgroups.borland.com> Subject: Re: Tooltips - TTN_SHOW return value Date: Wed, 19 Nov 2003 14:04:08 -0800 Lines: 47 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.1165 NNTP-Posting-Host: 67.22.137.149 Message-ID: <3fbbe7f4$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1069279220 67.22.137.149 (19 Nov 2003 14:00:20 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail