That was the DOS world. Now there are many programs runnng, and any one of them could have focus. What are you trying to do? There might be a Windows method to do what you want.