How can I track all the files opened by a software?

4.4k views Asked by At

I want to write a monitor program. It will monitor a special software. When this software open files, it remember the launch history. So I can make my own "Favorite file" or "History" system for some software.

i.e. I use Total Commander frequently. I used tc as a program launcher. Most of my docs or programs opened in TC. But TC does not have a open file history system. So I plan to make one.

When the files opened in TC. TC is the parent process. I think there is a way to write C# code to get all the files opened by TC (It is about message sending and monitor code). TC is written in delphin, It use stand listbox control. C# could solve the problem nice.

But I am new to C#, I have a little Autohotkey and python programming skill. I am learning C# now. Can someone give me some tips to write the code? Core idea is OK, I will handle with the GUI things.

2

There are 2 answers

1
bryanmac On

You may not need to write your own. Process monitor from sysinternals/Microsoft can monitor files. And with the filters you can filter by process.

http://technet.microsoft.com/en-us/sysinternals/bb896645

0
Deamonpog On

im also doing a child monitoring software for university project. i found a few solutions for doing this.

  1. Windows HOOK and intercept all the fileread write..etc.(hard & complex)
  2. why not just check MyRecentDocuments folder... :P ( user may change settings which has both pros and cons)

donno if we can use "Process" class and do something.. :P

EDIT----------------

i almost forgot... when i was implementing the Process Monitoring Component, i found that when a user double clicks a file "dllhost.exe" gets to run. :) i guess u hv a clue of what to do now.. im also still working on it..