Einzelnen Beitrag anzeigen

yvesdaeschle

Registriert seit: 22. Nov 2004
Ort: Efringen
26 Beiträge
 
Delphi 6 Personal
 
#10

Re: Über Hook rechte Maustaste sperren

  Alt 7. Jan 2005, 15:24
Es geht!!

Ich Erstelle den Hook so: also mit WH_GETMESSAGE:

SetWindowsHookEx(WH_GETMESSAGE, MsgFilterFunc, HInstance, 0); Und ich prüfe die Kombination von Strg und der rechten Maustaste so:

Delphi-Quellcode:
if (TPMsg (lParam)^.message = WM_RBUTTONUP) then
begin
  if GetASYNCKeyState (VK_CONTROL) <> 0 then
    TPMsg (lParam)^.message := WM_NULL;
end;
Result := CallNextHookEx(MMFData.NextHook, Code, wParam, lParam);
Ich ändere ja den Parameter, macht das was, gegenüber den anderen Programmen die diesen Hook verwenden?

Zitat:
Return Value

If nCode is less than zero, the hook procedure must return the value returned by CallNextHookEx.

If nCode is greater than or equal to zero, and the hook procedure did not process the message, it is highly recommended that you call CallNextHookEx and return the value it returns; otherwise, other applications that have installed WH _MOUSE hooks will not receive hook notifications and may behave incorrectly as a result. If the hook procedure processed the message, it may return a nonzero value to prevent the system from passing the message to the target window procedure.
Danke euch nochmal!
  Mit Zitat antworten Zitat