thanks for your reply.

my question is press F2 or other key to reset set focus on Program A when the focus is on Program B.
Not from one program and call another program.

I think that Program A should keep on running and wait for a key pressed even if it has no focus on it. When a key pressed, Program A catches it (get focus). This is my problem. I know that we can use 'API', but don't know which one and how.