I guess we are at the end of the road here. I will probably omit the keyboard code (which is ok), or use the non-directx keyboard. It might be a bug, but it also might be something weird with my machine. I've done the virus, spyware & rootkit scans. Certainly does seem to be Direct X-related as I mentioned before that taking out WindowedScreen code avoids this problem. I think this issue could be a trap for someone in the future.
Anyway I appreciate your extensive help netmaestro. I also appreciate Trond's code since omitting the keyboard code was the key.
process still running after quitting the app
Interesting. I copied your code to try. I reformatted it to my analmskuma wrote:Thanks Xombie.Xombie wrote:Another thing to try on yours ... put ExamineKeyboard() before OpenWindowedScreen() and try it.

One other thing I noticed is that when I got the problem of the program hanging in memory, it used roughly 19.5 mb. When it would correctly close out, it would only use around 3.2 mb.
And I didn't know ExamineKeyboard() used DirectX. I had thought it used GetKeyboardState_(). Huh.