Einzelnen Beitrag anzeigen

Robert Marquardt
(Gast)

n/a Beiträge
 
#2

Re: Mausradrichtung bei Journalhook ermitteln

  Alt 5. Jul 2007, 11:31
Ich habe mal das with beseitigt, denn es ist hier unpraktisch.
Delphi-Quellcode:
function MouseHookProc(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
var
  P: PEventMsg;
  Delta: Smallint;
begin
  If nCode = HC_ACTION then
   begin
    If lParam <> 0 then
     begin
      P := PEventMsg(lParam);
      If P^.Message = WM_MOUSEWHEEL then
       begin
        // HIWORD extrahiert ein WORD das man zu einem Smallintumtypen muss, damit das Vorzeichen wieder auswertbar wird.
        Delta := Smallint(HIWORD(P^.wParam));
        Inc(Form1.i);
        Form1.Label1.Caption := IntToStr(Form1.i);
       end;
     end;
   end;
  Result := CallNextHookEx(Form1.MouseHook, nCode, wParam, lParam);
end;
  Mit Zitat antworten Zitat