View Single Post
Old Apr 14th, 2006, 12:25 AM   #2
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,206
Rep Power: 5 grumpy is on a distinguished road
Why not place it in a separate thread? All the thread function needs to do is a continual loop that calls FindWindow(), closes the window if found, and sleeps for 1 second. Preferably, it would also check some flag so that, as your program exits, it could simply set that flag and the thread would terminate within 1 second.

As an aside, I'm not convinced that the best way to implement a "Download Blocker" is to simply close windows that are associated with a download. The workaround would be a little program that runs more frequently and sets the window label to something different --- or, even better, closing down your "Download Blocker". A better way would be to prevent programs from opening a network connection. Of course, that stops all email clients and browsers.
grumpy is offline   Reply With Quote