Здравствуйте дорогие форумчане
Кто может помочь с простой проблемой:
надо узнать знак Delta (т.е. в какую сторону крутится колесико) при создании хука WH_JOURNALRECORD.
Вот мой код:
Код:
function JournalProc(nCode, wParam: Integer; var EventStrut: TEventMsg): Integer; stdcall;
var
X, Y: Integer;
Delta: Integer;
begin
Result := CallNextHookEx(JHook, nCode, wParam, Longint(@EventStrut));
if(nCode < 0) then Exit;
if(nCode = HC_SYSMODALON) then Exit;
if(nCode = HC_ACTION) then begin
Case EventStrut.message of
...
WM_MOUSEWHEEL: begin
X := EventStrut.paramL;
Y := EventStrut.paramH;
Delta := ??? // пытался получить так: Delta := SmallInt(HiWord(EventStrut.paramH) div WHEEL_DELTA; но результат всегда равен "0"
end;
end; // Case
end;
С ловушкой WH_MOUSE_LL, либо же просто WH_MOUSE все более менее понятно (Delta := (SmallInt(HiWord(MS.mouseData)) div WHEEL_DELTA)).
Делал по MSDN:
If the message is WM_MOUSEWHEEL, the high-order word of this member is the wheel delta. The low-order word is reserved. 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. One wheel click is defined as WHEEL_DELTA, which is 120
но этот метод не подходит.
Подскажите, кто может
Заранее, спасибо.