I need to generate an event when a file is closed by another app.
Unfortunately, ReadDirectoryChangesW doesn't report the close event. It would be possible for me to poll (with a TTimer) any file that reported by ReadDirectoryChangesW as modified, waiting for it to be closed (using CreateFile to detect this).
However, what I'd prefer is a completely event driven solution.
Is there a way to hook system calls and detect all file closing events? I simply want to know the path & name of any file that has just been closed.
There is no good simple solution to your problem in Delphi alone - the real solution is to write a filter driver to monitor file closing events.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With