FindFirstChangeNotification can be used in a background thread if you want 'quiet' monitoring'
Paul A Norman >From the platform SDK ms-help://MS.PSDK.1033/fileio/base/obtaining_directory_change_notifications.htm Obtaining Directory Change Notifications An application can monitor the contents of a directory and its subdirectories by using change notifications. Waiting for a change notification is similar to having a read operation pending against a directory and, if necessary, its subdirectories. When something changes within the directory being watched, the read operation is completed. For example, an application can use these functions to update a directory listing whenever a file name within the monitored directory changes. An application can specify a set of conditions that trigger a change notification by using the FindFirstChangeNotification function. The conditions include changes to file names, directory names, attributes, file size, time of last write, and security. This function also returns a handle that can be waited on by using the wait functions. If the wait condition is satisfied, FindNextChangeNotification can be used to provide a notification handle to wait on subsequent changes. The FindCloseChangeNotification function closes the notification handle. Another way to monitor directory changes is by using the ReadDirectoryChangesW function. To track changes on a volume, see change journals. The following example monitors the directory tree starting at C:\ for directory name changes. It also monitors the C:\Windows directory for file name changes. The example uses the FindFirstChangeNotification function to create two notification handles and the WaitForMultipleObjects function to wait on the handles. Whenever a directory is created or deleted in the tree starting at C:\ , the example updates the entire directory tree. Whenever a file is created or deleted in the C:\Windows directory, the example refreshes the directory. << then a whole lot of C follows>> On Wed, 26 Jan 2005 09:41:05 +1300, Robert Wilson <[EMAIL PROTECTED]> wrote: > > hi Thanks > > Found it "FindFirstChangeNotification" > > Typical as soon as you ask someone it leaps out of the page/screen into your > face.. > > > Regards > Robert > > > ________________________________ > > Attention: > Disclaimer: > > The information in this electronic mail message is confidential and may be > legally privileged. It is intended solely for the addressee. Access to this > Internet electronic mail message by anyone else is unauthorised. > > If you are not the intended recipient, any disclosure, copying, distribution > or any action taken or omitted to be taken in reliance on it is prohibited > and may be unlawful. > If you have received this e-mail by mistake please call the sender > immediately on 09 415 4747 and erase the original message and any > attachments. > > Cellular Cellnet (NZ) Ltd accepts no responsibility for any effects this > email message or attachments has on the recipient network or computer > system. ________________________________ > > > > > > _______________________________________________ > Offtopic mailing list > [email protected] > http://ns3.123.co.nz/mailman/listinfo/offtopic > > > _______________________________________________ Offtopic mailing list [email protected] http://ns3.123.co.nz/mailman/listinfo/offtopic
