What I want to achieve
I have a console application that runs a file system watcher for USB drives.
When I try to eject device, I receive prompt message notifying device is in use.
I want to capture that request, close the file system watcher and resume the USB eject process.
I don't want eject notification (i.e; Event fired after USB is removed).
What I've tried
I've Tried These Method 1 Method 2 Method 3
The method 1 is a winform application, it works but It would be great if I could do it in a Console application.
In method 2 event is fired only after USB is removed, but I want to capture the event before it is ejected.
Method 3 is a windows service application, I can't get the DriveID (eg: F) in this.
Sorry for any mistakes. Thanks for the help.