When I have found a certain Process
, is there any way to listen for all keypresses made when the process window is in focus?
I know that I can register a global key listener. But is there any way to use it only when my process window is "active"/in focus? Or even better; is there a way to capture keys from my process only?
foreach (Process clsProcess in Process.GetProcesses()) {
if (clsProcess.ProcessName.Contains("myProcess"))
{
Process theProcess = clsProcess;
}
}
Global hotkeys implementation: Capture a keyboard keypress in the background