I've been playing with this, and have writting a nice program for my own use.

This program, however, is designed to stay open while I go do other stuff.

My problem: I can be in an entirely different window, yet if I hit one of the keys my program is reading, it tries to process it, causing great confusion to me.

So I am looking for

GetAsyncKeyStateButOnlyIfMyWindowIsActive

LOL

or, failing that, a test to see if my window is active. I could put that in the timer loop to ignore everything unless I am active.

Or maybe there is a better way? For example, a SUB to get control when my program becomes inactive (which could turn off the timer) and another one when it becomes active again (to turn timer on)