Is there an API in Windows so that any time a user saves a file, opens a file, etc in Windows Explorer you can have a handler in between it? For instance I made these up but I'm looking for something that works similar:
event('before_file_save', handler that gets passed the file/directory info to run code before it is saved)
event('before_file_open', handler that gets passed the file/directory info to run code before the file is opened)
And others for when any file is copied, pasted, moved, etc inside of Windows / Windows Explorer
CodePudding user response:
Well, these are the best ones I've found so far, with projected-file-system and cloud-files being a new win10 feature, I really think all of this stuff could have been designed so much better though and more accessible. They should try to design the APIs as intuitively as possible and look at how the event system in JavaScript was implemented and make things easier to program which is definitely possible, it could be much better:
- https://docs.microsoft.com/en-us/windows/win32/projfs/projected-file-system
- https://docs.microsoft.com/en-us/windows/win32/projfs/projfs-programming-guide
- https://docs.microsoft.com/en-us/windows/win32/cfapi/cloud-files-api-portal
- https://docs.microsoft.com/en-us/windows/win32/cfapi/cloud-filter-reference
- https://docs.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine
- https://docs.microsoft.com/en-us/windows/win32/shell/nse-works
- https://docs.microsoft.com/en-us/windows/win32/shell/handlers
- https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/
- https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/filter-manager-concepts
CodePudding user response:
See Win32 API functions: FindFirstChangeNotification, FindNextChangeNotification (https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findfirstchangenotificationa).
