TImage - MOUSE SCROLL WHEEL lazarus / 7-LCL ---------------------------------------------------------------------- Boshu · 2006-04-06 09:06 Hi! ...   protected   PROCEDURE MOUSEMOVE(SHIFT:TSHIFTSTATE;X,Y:LONGINT);OVERRIDE;   PROCEDURE MOUSEDOWN(BUTTON:TMOUSEBUTTON;SHIFT:TSHIFTSTATE;X,Y:LONGINT);OVERRIDE;   PROCEDURE MOUSEUP(BUTTON:TMOUSEBUTTON;SHIFT:TSHIFTSTATE;X,Y:LONGINT);OVERRIDE;   public .... These are the procedures i use to intercept mouse events in a custom TImage. I can't find the procedure triggered by mouse wheel events. Is it implemented? If it's not then please reply this message in order to add it to Mantis. Bye! ---------------------------------------------------------------------- felipemdc · 2006-05-24 13:30 You can handle those messages yourself. First you need to rebuild lazarus putting this as commandline option: -dPassWin32MessagesToLCL Now you can modify and use this sample code: {******************************************************************* *  TMainWindow.WndProc () * *  DESCRIPTION:    Window function of the main window. *                  Only handles manually the messages for the taskbar icon. *                  Other messages are forwarded to the Component Library * *  PARAMETERS:     Standard window function parameters * *  RETURNS:        Nothing * *******************************************************************} {$IFDEF Win32} procedure TMainWindow.WndProc(var Message : TMessage); var   pt: TPoint;   i: Integer;   delta: ShortInt;   wheel_delta: Word;   rotation: Double; begin   case Message.msg of     WM_HOTKEY: ExecuteLens(Self);     WM_MOUSEWHEEL:     begin       wheel_delta := HiWord(Message.WParam);       Move(wheel_delta, delta, SizeOf(Word));       rotation := delta / WHEEL_DELTA;       if (rotation > 0.0) then delta := Round(rotation + 0.5)       else delta := Round(rotation - 0.5);       for i := 1 to abs(delta) do       begin         // Call same code as from VK_ADD, VK_SUBTRACT handlers         if (delta > 0.0) then          vConfigurations.iMagnification := vConfigurations.iMagnification + 0.5         else vConfigurations.iMagnification := vConfigurations.iMagnification - 0.5;       end;       // Hard limits for the magnification       if vConfigurations.iMagnification < 1.0 then vConfigurations.iMagnification := 1.0       else if vConfigurations.iMagnification > 16 then vConfigurations.iMagnification := 16;       vGlass.Repaint;     end;   else     {*******************************************************************     *  All other messages from the Window are handled by the Component Library     *******************************************************************}     inherited WndProc(Message);   end; end; {$ENDIF}