EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Notification of Drive Mount

Posted: 12/09/2008 05:02:16
by Tim Hayes (Standard support level)
Joined: 06/06/2007
Posts: 36


It appears to take Windows several seconds after the drive is mounted, before Windows reacts and displays the new drive in the shell window. This is no different to plugging in a USB memory stick.

However, I want my program to be able to open a shell window once the drive is mounted. What might be the best way to recognise that the drive is now mounted?

Posted: 12/09/2008 05:34:50
by Volodymyr Zinin (Team)


You can use ShellExecute/ShellExecuteEx to show a new Explorer window after a virtual drive has been created.
For recognizing that the drive is mounted try for example to enumerate files on it using the win32 api FindFirstFile.
Posted: 12/09/2008 05:42:25
by Tim Hayes (Standard support level)
Joined: 06/06/2007
Posts: 36

Thanks, I can open the window OK with ShellExecute, the problem is identifying that the drive is mounted and recognised by Windows. I don't want to be stuck in a permanent loop looking for it. I guess I need some sort of shell notification event?
Posted: 12/09/2008 09:07:26
by Volodymyr Zinin (Team)

There is a windows message that is sent (broadcasted) after the mounting point is created. It's WM_DEVICECHANGE. But this message is sent by our code that creates mounting point.
So if it's not possible to open an Explorer window right after a mounting point creation then I see only a way with polling the storage in loop.



Topic viewed 2474 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!