Hello,
I need to hook the keyboard in windows.
From a tutorial I got this codeSetWindowsHookEx(WH_KEYBOARD,
{callback —>} @KeyboardHookProc,
HInstance,
GetCurrentThreadId())However this code is in Delphi. It works with $mode delphi, but not with objfpc.
I'm quite addicted to objfpc, and I wanted to rewrite the code in it. But this SetWindowsHookEx has another declaration then in delphi.
I get this message from the compiler:
code.pas(44,45) Error: Incompatible type for arg no. 2: Got "<address of function(LongInt, Word, LongInt):LongInt;StdCall>", expected "<procedure variable type of function(LongInt, LongInt, LongInt):LongInt;StdCall>"
Could somebody show me an example of using this in objfpc?
Thank you