Can't compile code with function SetWindowsHookEx lazarus / 34-Windows ---------------------------------------------------------------------- M[a]nny · 2014-08-25 08:58 Hi, in attachment is placed code i tried but it still returns these errors: Code: [Select]unit1.pas(64,62) Error: Incompatible type for arg no. 2: Got "", expected "" unit1.pas(65,62) Error: Incompatible type for arg no. 2: Got "", expected "" Does anybody know how to write this code to be successfuly compiled, please? I use Lazarus v1.2.2 Thanks for any ideas. ---------------------------------------------------------------------- howardpc · 2014-08-25 09:15 Remove the two LowLevelxxx functions from your TForm1 class declaration, and declare them as standard Pascal functions, identically to how they are presently declared except outside the form class, thus: Code: [Select]function LowLevelKeybdHookProc(nCode: LongInt; WPARAM: WPARAM; lParam : LPARAM) : LRESULT; stdcall; function LowLevelMouseHookProc(nCode: LongInt; WPARAM: WPARAM; lParam : LPARAM) : LRESULT; stdcall;            The implementations will need "TForm1." removing from their names. ---------------------------------------------------------------------- M[a]nny · 2014-08-25 09:22 Thank you very much. It works