Have you had a look at GetActiveWindow that wll return the HWND so you can then check that to see if your in your game.