You can't reliably call ToUnicodeEx() from an external process. You can't swing a cat without running into example code, google will give you plenty. So be sure to use something known-to-work if you have never written such a hook before, it will avoid a lot of grief. WH_KEYBOARD ...