Board index » cppbuilder » MouseWheel on combo box

MouseWheel on combo box


2008-07-07 03:52:17 PM
cppbuilder66
Hi!
I have a lot of problem with a combo box and the mouseWheel event. This
kind of control doesn't has the "OnMouseWheel" event.
How I can redirect the "OnMouseWheel" event to the form?
I've just read that I can override the WndProc and then redirect the
event to the Form, but all the tutorial explain how to do it in Delphi.
Thanks for your attention!
P.S.: I know that is the second post on it, but this problem is too big
for me.
 
 

Re:MouseWheel on combo box

Quote
How I can redirect the "OnMouseWheel" event to the form?

I've just read that I can override the WndProc and then redirect the event
to the Form, but all the tutorial explain how to do it in Delphi.

in your class form declaration add:
void __fastcall NewWindowProc(TMessage &Msg);
TWndMethod OldWindowProc;
in your form constructor put:
OldWindowProc = WindowProc;
WindowProc = NewWindowProc;
...
void __fastcall TForm::NewWindowProc(TMessage &Msg)
{
switch(Msg.Msg)
{
....
}
if (no_propagate)
Msg.Result = 1;
//pass on to the default handler to let it do its thing
OldWindowProc(Msg);
}
Ciao
 

Re:MouseWheel on combo box

PaoloItaly ha scritto:
Quote
>How I can redirect the "OnMouseWheel" event to the form?
>
>I've just read that I can override the WndProc and then redirect the event
>to the Form, but all the tutorial explain how to do it in Delphi.
>
in your class form declaration add:
void __fastcall NewWindowProc(TMessage &Msg);
TWndMethod OldWindowProc;
in your form constructor put:
OldWindowProc = WindowProc;
WindowProc = NewWindowProc;
...
void __fastcall TForm::NewWindowProc(TMessage &Msg)
{
switch(Msg.Msg)
{
....
}
if (no_propagate)
Msg.Result = 1;
//pass on to the default handler to let it do its thing
OldWindowProc(Msg);
}

Ciao


THANKS!!!!!!!!!!!!!!!!!!!!
IT WORKS VERY WELL...
Ciao, buona giornata!!
 

{smallsort}

Re:MouseWheel on combo box

Hi "Paolo Italy".
I like your answer.
Can I speak directly with you?
I am Gian Luca Spadotto
XXXX@XXXXX.COM
my mail to XXXX@XXXXX.COM returns "Recipient address rejected: User
unknown in virtual mailbox table"
"PaoloItaly" < XXXX@XXXXX.COM >ha scritto nel messaggio
Quote
>How I can redirect the "OnMouseWheel" event to the form?
>
>I've just read that I can override the WndProc and then redirect the
>event to the Form, but all the tutorial explain how to do it in Delphi.
>
in your class form declaration add:
void __fastcall NewWindowProc(TMessage &Msg);
TWndMethod OldWindowProc;
in your form constructor put:
OldWindowProc = WindowProc;
WindowProc = NewWindowProc;
...
void __fastcall TForm::NewWindowProc(TMessage &Msg)
{
switch(Msg.Msg)
{
....
}
if (no_propagate)
Msg.Result = 1;
//pass on to the default handler to let it do its thing
OldWindowProc(Msg);
}

Ciao