findfirstchangenotification (kernel32)
Last changed: -147.160.136.10

.
Summary

C# Signature:

[DllImport("kernel32.dll")]
static extern IntPtr FindFirstChangeNotification(string lpPathName,
   bool bWatchSubtree, uint dwNotifyFilter);

User-Defined Types:

None.

Notes:

Constants to pass for dwNotifyFilter. Found in winnt.h by searching for the ones used in the msdn example.

FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001

FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002

FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004

FILE_NOTIFY_CHANGE_SIZE 0x00000008

FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010

FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020

FILE_NOTIFY_CHANGE_CREATION 0x00000040

FILE_NOTIFY_CHANGE_SECURITY 0x00000100

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

System.IO.FileSystemWatcher

Documentation

C++ Language example using this api call.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/obtaining_directory_change_notifications.asp (dead link)

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365261(v=vs.85).aspx