Hi I believe this is what you are looking for

http://delphi.about.com/cs/adptips2002/a/bltip1102_3.htm


Just drop a TApplicationEvents ("Additional" tab on the Component Palette)
component on a form and handle it's OnMessage event as: 

~~~~~~~~~~~~~~~~~~~~~~~~~
procedure TForm1.ApplicationEvents1Message
   (var Msg: TMsg; var Handled: Boolean) ;
var
   i: SmallInt;
begin
   if Msg.message = WM_MOUSEWHEEL then
   begin
     Msg.message := WM_KEYDOWN;
     Msg.lParam := 0;
     i := HiWord(Msg.wParam) ;
     if i > 0 then
       Msg.wParam := VK_UP
     else
       Msg.wParam := VK_DOWN;

     Handled := False;
   end;
end;


I've noticed some discrepancies with the value of i and so you should put
some type of showmessage or write to the form caption with its value to get
the mouse events properly. (Caption := 'Value of Event : '+IntToStr(i);)

I would then modify the code above to include a case statement :

case i of
  1000 : VK_UP;
  2000 : VK_DOWN ... etc 
end;

Please note that 1000 and 2000 are merely for purposes of explaining.

Yours sincerely

Andre van Zuydam
Spiceware Software


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Whitehat
Sent: 13 January 2006 01:00 PM
To: Delphi-Talk
Subject: Wheel Mouse With Grids

I have a TStringGrid in an app and the selected cell
changes with the arrow keys. 

A new mouse with horizontal and vertival wheels moves
the scrollbars on the grid but the selected cell remains
the same. 

I can't program the mouse wheels to mimic the arrow keys,
and, if I could, it would mess up other applications.

So how can I make the wheels work like arrow keys in my
application?
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to