How to eject removable devices

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2007
Posts: 28
Reputation: badbloodyeyez is an unknown quantity at this point 
Solved Threads: 0
badbloodyeyez badbloodyeyez is offline Offline
Light Poster

How to eject removable devices

 
0
  #1
Jan 17th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 530
Reputation: selvaganapathy is an unknown quantity at this point 
Solved Threads: 91
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Pro

Re: How to eject removable devices

 
1
  #2
Jan 18th, 2009
Hi,

Use DeviceIoControl() API, to eject the removable storage media. Refer http://support.microsoft.com/kb/165721
Selva
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 28
Reputation: badbloodyeyez is an unknown quantity at this point 
Solved Threads: 0
badbloodyeyez badbloodyeyez is offline Offline
Light Poster

Re: How to eject removable devices

 
0
  #3
Jan 18th, 2009
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 557 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC