I have compiled this code (v2), and various homebrew variants of it on VC6 and VS.Net and they work flawlessly. The only nut I've been unable to crack is the LCC-Win32 compiler issue. It crashes with a C00000005 exception every time it picks up the global hook (keypress) and attempts to launch the relocated code.