In order to install a global hook, the program code that contains your hook procedure has to be injected by the operating system into the process of every running application. Since it's impossible to inject 32-bit code into a 64-bit process and visa versa, you have to create two DLLs, one 32-bit and one 64-bit, than you have to have a 32-bit process set the CBT hook to the 32-bit DLL and a 64-bit process set the CBT hook to the 64-bit DLL. Then you need a way for each of these DLLs to report back to your application (memory mapped files work very well).