I'm trying to play with this function, and I can't
get the VC++ 7.0 compiler to accept the
callback func in the 2nd arg.
Here's the def:
HOOKPROC wireKeyboardProc(
int code, // hook code
WPARAM wParam, // virtual-key code
LPARAM lParam // keystroke-message information
);
And here's the code:
SetWindowsHookEx (WH_KEYBOARD,wireKeyboardProc,NULL,0);
I've tried typecasts and typdefs, to no avail.
I tried passing a func with no args, but then
it said HOOKPROC(void) doesn't match
HOOKPROC. ???
Thanks for any help.
Ihor
If you look at the documentation, the declaration of keyboard hook proc
should be
LRESULT CALLBACK wireKeyboardProc(
int code,
WPARAM wParam,
LPARAM lParam
);
It returns LRESULT, not HOOKPROC, and should have CALLBACK calling
convention.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925