You can find out if your control has a keyboard focus by calling the GetFocus() API and compare it with the control's HWND handle. Your problem though is that you're trying to do this between two separate processes. I'm venturing to say that you're running your code on Windows XP or even earlier OS. The approach of using keybd_event() and SendInput() has been significantly redesigned in Windows Vista and Windows 7 that may make such incorrect interprocess communication obsolete. So my suggestion to you is to re-design your ways of doing this (i.e. put all your controls into the same process), or use other means of the IPC.