943,685 Members | Top Members by Rank

Ad:
Jan 17th, 2009
0

How to eject removable devices

Expand Post »
Hi, I want to know how can I eject a removable device. The device is assumed to be a USB memory stick and comes on a E drive so therefore I would like to safely remove the E drive when the user log off! The code for log off is as follows

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbAppWindows Then ' // Windows Is Shutting Down
' //
Cont = MsgBox(" Windows Is Shutting down! Good Bye?", vbYesNo)
If Cont = vbYes Then

I need to safely eject the E drive here can any one help thanks in advance
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
badbloodyeyez is offline Offline
28 posts
since Nov 2007
Jan 18th, 2009
1

Re: How to eject removable devices

Hi,

Use DeviceIoControl() API, to eject the removable storage media. Refer http://support.microsoft.com/kb/165721
Reputation Points: 44
Solved Threads: 101
Posting Pro
selvaganapathy is offline Offline
547 posts
since Feb 2008
Jan 18th, 2009
0

Re: How to eject removable devices

Hi, thanks for the link the code in there is in C is there a code in Visual basic to do the same thing. thaks
Reputation Points: 10
Solved Threads: 0
Light Poster
badbloodyeyez is offline Offline
28 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: vb 6.0 form into word
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: how to connect with data base add data





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC