Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Delphi Misc > Re: WndProc
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 16 Topic 5998 of 6154
Post > Topic >>

Re: WndProc

by Rob Kennedy <me3@[EMAIL PROTECTED] > Feb 27, 2008 at 07:56 PM

Fons wrote:
> This works fine:
> 
> procedure TFormTest.WndProc(var Message: TMessage);
> begin
>   inherited;
> 
>   if Message.LParam = longint(Label1) then begin
>     case Message.Msg of
>       CM_MOUSELEAVE : Label2.Caption := 'CM_MOUSELEAVE';
>       CM_MOUSEENTER : Label2.Caption := 'CM_MOUSEENTER';
>     end;
>   end;
> end;

You have it backward. The LParam field is _meaningless_ until you know 
which message it's the long parameter _to_. The first field to check 
should always be Msg, never WParam, LParam, or LResult.

> Until I put Label1 in a TPanel. If I catch WndProc of Label1, instead of

> the Form, I can make it work but there must be a better solution.

Why should there be? If you're interested in what's happening to the 
label, why shouldn't you handle messages sent to the label?

-- 
Rob
 




 16 Posts in Topic:
WndProc
Fons <fonzzzNO@[EMAIL   2008-02-27 21:11:20 
Re: WndProc
"Maarten Wiltink&quo  2008-02-27 22:32:19 
Re: WndProc
Fons <fonzzzNO@[EMAIL   2008-02-27 23:15:55 
Re: WndProc
Jamie <jamie_ka1lpa_no  2008-02-27 19:14:16 
Re: WndProc
Fons <fonzzzNO@[EMAIL   2008-02-28 17:45:24 
Re: WndProc
Jamie <jamie_ka1lpa_no  2008-02-28 19:40:31 
Re: WndProc
Rob Kennedy <me3@[EMAI  2008-02-27 19:56:07 
Re: WndProc
Fons <fonzzzNO@[EMAIL   2008-02-28 17:46:53 
Re: WndProc
Brad Blanchard <nadie1  2008-02-28 19:12:28 
Re: WndProc
Fons <fonzzzNO@[EMAIL   2008-02-28 19:34:26 
Re: WndProc
"Chris.Cheney"   2008-02-28 18:58:15 
Re: WndProc
"Maarten Wiltink&quo  2008-02-28 20:09:08 
Re: WndProc
Fons <fonzzzNO@[EMAIL   2008-02-28 20:21:29 
Re: WndProc
"Maarten Wiltink&quo  2008-02-28 20:29:11 
Re: WndProc
Fons <fonzzzNO@[EMAIL   2008-02-28 20:48:18 
Re: WndProc
"Maarten Wiltink&quo  2008-02-29 09:31:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 3:25:41 CDT 2008.