Discussion:
MouseWheel on combo box
(too old to reply)
Paolo Roberto Grassi
2008-07-07 07:52:17 UTC
Permalink
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.
PaoloItaly
2008-07-07 09:06:15 UTC
Permalink
Post by Paolo Roberto Grassi
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
Paolo Roberto Grassi
2008-07-07 12:08:55 UTC
Permalink
Post by PaoloItaly
Post by Paolo Roberto Grassi
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.
void __fastcall NewWindowProc(TMessage &Msg);
TWndMethod OldWindowProc;
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!!
Gian Luca Spadotto
2008-07-11 19:30:09 UTC
Permalink
Hi "Paolo Italy".
I like your answer.
Can I speak directly with you?
I am Gian Luca Spadotto
***@inwind.it

my mail to ***@sirius-es.it returns "Recipient address rejected: User
unknown in virtual mailbox table"
Post by PaoloItaly
Post by Paolo Roberto Grassi
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.
void __fastcall NewWindowProc(TMessage &Msg);
TWndMethod OldWindowProc;
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
Loading...