How can I know what trueCrypt volumes are mounted on a computer?
Note I already know what files can be mounted. In other words the only volumes that can be mounted are: C:\Vol1.tc
, C:\Vol2.tc
and C:\Vol3.tc
.
How do I know when a volume is dismounted?
I manage to do that by using the .net class
FileSystemWatcher
. Every time I dismount a volume I notice that the event FileSystemWatcher.Changed fires.
How do I know when a volume is mounted?
Here is where I am having trouble! Do I constantly query the drives and see if a drive exists. That sounds like a bad idea because if someone plugs in a usb and windows assigns that drive letter to it I will have an error. How can I know when a new virtual drive is created?
Why I need this?
I am required to create an application where the user can see what trueCrypt volumes are mounted from his phone. The only thing I am missing to do is find out when a volume is mounted...
As Eugene Mayevski 'EldoS Corp commented, you should use the WM_DEVICECHANGE event.
In combination with the answer I gave to you on this question, here is a sample Code :