07-21-2011, 09:27 AM
don't mean to bump an old thread here, but when debugging this even after I disable the Visual Studio hosting process this gives me an error when a key is pressed inside the KeyboardProc(integer,integer,kbdllhookstruct) function on the return stating "PInvoke Stack Imbalance...A call to PInvoke function 'XXXX!XXXX.KeyboardHook::CallNextHookEx' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature."
However after compiling and running from the exe it works fine without issue.
However after compiling and running from the exe it works fine without issue.