In Windows, key presses belong to the window that has focus. If your app doesn't have focus - as is your situation - they aren't yours and you normally are never told about them.
If, as you say, you do need to know about them, you have to establish a Windows hook and provide a callback function that will be called for such events. For more information see
here[
^] and
here[
^].