Does anyone have a FileSystemWatcher-like class in C++/WinAPI?
There is some public-domain code here. My current project uses this (inherited from previous developers). It works pretty well but we do miss notifications for reasons that are unclear (and possibly not caused by this code).
Note that the Win32 API here has some limitations which make it difficult/impossible to avoid missing notifications. Background and alleged work-round for the API are here
What about the ReadDirectoryChangesW function?
http://msdn.microsoft.com/en-us/library/aa365465(VS.85).aspx
It stores notifications in a buffer so you don't miss any changes (unless the buffer overflows)
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.created%28v=vs.71%29.aspx the above does throgh C#, we can always write a COM Wrapper
2021 answer:
A forked version of the repo listed below that is actively maintained: https://github.com/SpartanJ/efsw
Old answer:
This is a cross-platform solution, but does the job wrapping the Win32 stuff nicely: https://github.com/jameswynn/simplefilewatcher