How do I get the list of open file handles by proc

2019-01-28 12:18发布

问题:

How do I get the list of open file handles by process id in vb6?

I'm interested in digging down and getting the file names as well.

Looking for the programmatic equivalent of what process explorer does.

Thanks In Advance

回答1:

Use Handle.exe from Sysinternals.

Shell ("c:\...\handle.exe ... >> " & app.path & "\tmp.txt",vbHide)
   '...Write something which will get contents from App.path & "\tmp.txt" ...
   '...Wait some time ,because killing the file at this moment 
   'will bring an error
Kill App.Path & "\tmp.txt"


标签: vb6 process