Monitor File Open, Save and Close events on Windows

SumantSumant Posts: 2
edited March 19, 2014 12:37AM in PInvoke.Net
I have a somewhat unique requirement where I need to track or monitor file open, save or close events and log the timestamp to a file or database. File could be either on the local machine or on a shared path. OS is Windows 7.

I have tried using the WMI events subscription for process creation, modification and deletion. However it works only for file types like notepad because it creates a new process for each file while Office files are managed through a single process. I stumbled across the NetFileEnum function which provides a list of files opened from a shared path. Is there a similar function which provides a list of files opened from local machine?

I am thinking if I dont get the events I have to use the polling mechanism which will run every few mins and keep checking for open and closed files. Win32 API seems to be the only option. FileWatcher does not help.

Please provide your valuable suggestions
Sign In or Register to comment.