by Gordon Campbell
I created a test program that illustrates how to 'watch a folder' in MS Windows. The code can be downloaded at: http://www.epro-sys.com/samples/watchfolder.w The sample watches a directory called c:\watch\in and via an IP (ProcessFile) moves the contents to c:\watch\out. The ProcessFile IP can be modified to process a file in the 'in' directory. You could use this to automate conversion of text files to PDF via PDFinclude or automate the sending of documents to e-mail addresses .... or whatever automated process you would consider when dealing with a file. Later, Gordon Campbell WIKA Instruments Ltd.
This source code example uses the following Win32 API functions:
* FindFirstChangeNotificationA
* FindCloseChangeNotification
* FindNextChangeNotification
* WaitForSingleObject
Just to be on the safe side, I have also attached a copy of his source code:
watchfolder.w.zip : original from Gordon Campbell