Hola Felipe.
En otra prueba me dí cuenta que el código anterior dejaba fuera al
TForm por ejemplo.
De este modo queda contemplado:
Código Delphi
[-]
procedure TForm1.MouseWheel(var Msg: tagMSG; var Handled: Boolean);
var
i: SmallInt;
FControl: TWinControl;
begin
FControl:= FindVCLWindow(Mouse.CursorPos);
if Msg.message = WM_MOUSEWHEEL then
begin
if (GetWindowLong(FControl.Handle, GWL_STYLE) and WS_VSCROLL <> 0) then begin
Msg.message := WM_KEYDOWN;
Msg.lParam := 0;
i:= HiWord(Msg.wParam);
if (FControl is TScrollingWinControl) then begin
with TScrollingWinControl(FControl).VertScrollBar do
if i > 0 then
Position:= Position - Increment
else
Position := Position + Increment;
end
else if FControl.Focused then begin
if i > 0 then
Msg.wParam := VK_UP
else
Msg.wParam := VK_DOWN;
end;
end;
end;
Handled := False;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage:= MouseWheel;
end;
Un saludo.