FileMonitorPInvoke is a open-source C# application that makes use of the Windows API functions, like FindFirstChangeNotification, FindNextChangeNotification, and ReadDirectoryChangesW, to track file changes in a specified directory. It allows you to monitor file additions, deletions, and modifications. The project is licensed under the permissive MIT License, allowing everyone to freely use, modify, and include the code in their projects, as long as they credit the original author.
Disclaimer: While FileMonitorPInvoke provides a way to track file changes using Windows API functions, you may also consider using the built-in FileSystemWatcher class in C#. FileSystemWatcher offers a more feature-rich and managed solution with simplified event-driven file monitoring, which may better suit your needs. ¯_(ツ)_/¯
The application is loosely based on the example from Microsoft's documentation Obtaining Directory Change Notifications, providing a reliable and simplified solution for file monitoring.
A heartfelt special thanks to Mario for his valuable inputs and generous support.