I'm trying to write a program that will look in a couple of directories for new files to appear. I currently have two threads that poll in their respective directories for files, then Sleep() for 5 seconds and check again. For some reason, this method uses up almost all of the CPU time
I read a post in this forum yesterday that used FindFirstChangeNotification and WaitForMultipleObjects to search two directories that I was hoping wouldn't use up the CPU, but I can't figure out the search string that I used to find it
Could some please give me an example of how to do this, or point me to the thread that gave this example?

Thanks.