Mouse wheel support

ALthough my mouse wheel works fine in other applications, it appears that both Delphi 7 IDE and applications ignore it

For example, a form with scroll bars showing does not respond

Anyone know how to fix this?
Paul197466Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

paulb1989Commented:
There is a component here: http://delphi.icm.edu.pl/ftp/d30free/mwheel.zip

But it is for delphi 3 so it may need some code changes for it to work in a newer version.
0
ricswikaCommented:
Here is a quick and dirty way, but it works.


procedure TMainForm.FormCreate(Sender: TObject);
begin
  Application.OnMessage := ApplicationMessageHandler;
end;

procedure TMainForm.ApplicationMessageHandler(var Msg:tmsg;var handled:boolean);
var
  i:SmallInt;
begin
if msg.message=WM_MOUSEWHEEL then
  begin
  msg.message:=WM_KEYDOWN;
  msg.lParam:=0;
  {$R-}
  i:=hiword(msg.wParam);
  {$R+}
  if i>0 then
    msg.wParam:=VK_UP
  else
    msg.wParam:=VK_DOWN;
  handled:=false;
  end;
end;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Paul197466Author Commented:
I tried this and although message is trapped, the spoofed message does not scroll the main form or any other form
0
ricswikaCommented:
Agreed..the control must have the focus and respond to up/down arrow keys.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.