delphi 3 wheely mouse support

I want wheely mouse support for my d3 app.  I know d4 has built in support. but any ideas as to how to implement for d3?  I cant find anything in the api/help file to help me out on this. ta. paul.
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.


this is the struct from D5

  TWMMouseWheel = packed record
    Msg: Cardinal;
    Keys: SmallInt;
    WheelDelta: SmallInt;
    case Integer of
      0: (
        XPos: Smallint;
        YPos: Smallint);
      1: (
        Pos: TSmallPoint;
        Result: Longint);

and this the message you get from windows

procedure WMMouseWheel(var Message: TWMMouseWheel); message WM_MOUSEWHEEL;

Hi Heapster,
here is a demo about IntelliMouse and wm_MouseWheel in
Delphi Magazine Issue 32 Free Disk
(After unzipping, look in the System directory, Unzip System32.ZIP, and look at the MouseDemo project) 

direct links to components from dsp:

http://ftp/d20free/  (162,087 bytes) Provides forms with Microsoft Intellimouse MouseWheel messages. Win 95 + Win NT. Automatically scrolls grid, listbox, edit, memo control. (ver. 1.4, added 1/4/98, updated 2/12/98, no src.)   by Bruno Fierens  

--------------------------------------------------------------------------------   TWheelMouse is a component that enables your programs to have consistent support for the wheel on new mice, such as the Intellimouse, whether the operating system has native wheel handling (NT4/98) or not (Win95). (ver. 1.13, added 3/15/98, updated 8/24/98, no src., This is the trial version which only works when Delphi is running. Registered version $18, with full source code.)  by Simon Page    


http://ftp/d30free/    (957 bytes) Provide a simple component for using the mouse wheel on the Microsoft Intellimouse (and compatible) for scrolling onscreen controls. Delphi 3, Windows 98/NT 4.0. (ver. 1.00, added 11/15/98)  by John B. Davis    

Regards Barry

extarct from the gexperts code librarian :

#if(_WIN32_WINNT >= 0x0400)
#define WM_MOUSEWHEEL                   0x020A
#if (_WIN32_WINNT < 0x0400)
#define WM_MOUSELAST                    0x0209
#define WM_MOUSELAST                    0x020A
#if(_WIN32_WINNT >= 0x0400)
#define WHEEL_DELTA                     120     /* Value for rolling one detent */
#if(_WIN32_WINNT >= 0x0400)
#define WHEEL_PAGESCROLL                (UINT_MAX) /* Scroll one page */
#define WM_PARENTNOTIFY                 0x0210
#define MENULOOP_WINDOW                 0
#define MENULOOP_POPUP                  1
#define WM_ENTERMENULOOP                0x0211

#define MOUSEEVENTF_WHEEL       0x0800 /* wheel button rolled */

procedure tmditted.applicationonmessage(var Msg: TMsg; var Handled: Boolean);
  if (msg.message = 52294) and (MDIchildcount > 0) then //Kollar rullknappen pO en microsoft intellimouse
    case msg.wparam of
      -120 : activemdichild.activecontrol.perform (em_linescroll,0,-1);
       120 : activemdichild.activecontrol.perform (em_linescroll,0,1);


The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is
rotated. The DefWindowProc function propagates the message to the windows parent.
There should be no internal forwarding of the message, since DefWindowProc
propagates it up the parent chain until it finds a window that processes it.

fwKeys = LOWORD(wParam);    // key flags
zDelta = (short) HIWORD(wParam);    // wheel rotation
xPos = (short) LOWORD(lParam);    // horizontal position of pointer
yPos = (short) HIWORD(lParam);    // vertical position of pointer


  Value of the low-order word of wParam. Indicates whether various virtual keys
  are down. This parameter can be any combination of the following values:

      Value        Description
      MK_CONTROL   Set if the CTRL key is down.
      MK_LBUTTON   Set if the left mouse button is down.
      MK_MBUTTON   Set if the middle mouse button is down.
      MK_RBUTTON   Set if the right mouse button is down.
      MK_SHIFT     Set if the SHIFT key is down.

     The value of the high-order word of wParam. Indicates the distance that the
     wheel is rotated, expressed in multiples or divisions of WHEEL_DELTA, which is
     120. A positive value indicates that the wheel was rotated forward, away from
     the user; a negative value indicates that the wheel was rotated backward,
     toward the user.
     Value of the low-order word of lParam. Specifies the x-coordinate of the pointer,
     relative to the upper-left corner of the screen.
     Value of the high-order word of lParam. Specifies the y-coordinate of the pointer,
     relative to the upper-left corner of the screen.


The zDelta parameter will be a multiple of WHEEL_DELTA, which is set at 120. This is
the threshold for action to be taken, and one such action (for example, scrolling one
increment) should occur for each delta.

The delta was set to 120 to allow Microsoft or other vendors to build finer-resolution
wheels in the future, including perhaps a freely-rotating wheel with no notches. The
expectation is that such a device would send more messages per rotation, but with a
smaller value in each message. To support this possibility, you should either add the
incoming delta values until WHEEL_DELTA is reached (so for a given delta-rotation you
get the same response), or scroll partial lines in response to the more frequent
messages. You could also choose your scroll granularity and accumulate deltas until it
is reached.


  Windows NT: Use version 4.0 and later. Implemented as ANSI and Unicode messages.
  Header: Declared in winuser.h.
see my comment for components or code to deal with wheely-mouse.

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
HeapsterAuthor Commented:
Plenty of options for me there inthe - thanks.

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

From novice to tech pro — start learning today.