views:

18

answers:

1

How do I get events about changed files, directories and media in a Windows service?

+2  A: 

If your service is written in a .NET language, you can use System.IO.FileSystemWatcher to monitor file/folder changes.

Jonners
How would this be done using native c++?
Wienczny
I guess if MFC has no direct equivalent of FileSystemWatcher (and I'm not a C++ coder, so I'll defer that question to others) you'd need to invoke a background thread that periodically checked specific parts of the filesystem and alerted the main application if a change were observed.
Jonners