Hi ,i've these Functions declared in my
Dll , i'm focusing on
StartHook and
StopHook , if i use them in a standalone Application all goes well .
But the problem is when using them in a Service i don't get any result there's no Hook .
Delphi-Quellcode:
function HookProc(code: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
begin
Result := CallNextHookEx(Code, code, wParam, lParam)
end;
procedure StartHook; stdcall;
begin
HookHandle := SetWindowsHookEx(WH_GETMESSAGE, HookProc, hInstance, 0);
end;
procedure StopHook; stdcall;
begin
UnhookWindowsHookEx(HookHandle);
end;
The issue is only with Vista and up .