[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Mouse wheel support

Posted on 2004-12-01
4
Medium Priority
?
606 Views
Last Modified: 2010-04-05
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?
0
Comment
Question by:Paul197466
  • 2
4 Comments
 
LVL 5

Assisted Solution

by:paulb1989
paulb1989 earned 500 total points
ID: 12720387
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
 
LVL 1

Accepted Solution

by:
ricswika earned 500 total points
ID: 12721330
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
 

Author Comment

by:Paul197466
ID: 12721452
I tried this and although message is trapped, the spoofed message does not scroll the main form or any other form
0
 
LVL 1

Expert Comment

by:ricswika
ID: 12727010
Agreed..the control must have the focus and respond to up/down arrow keys.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month18 days, 4 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question