| | |
How to eject removable devices
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2007
Posts: 28
Reputation:
Solved Threads: 0
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
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
Hi,
Use DeviceIoControl() API, to eject the removable storage media. Refer http://support.microsoft.com/kb/165721
Use DeviceIoControl() API, to eject the removable storage media. Refer http://support.microsoft.com/kb/165721
Selva ![]() |
Similar Threads
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
- Can't boot from a DVD or CD/R drive? (Troubleshooting Dead Machines)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: vb 6.0 form into word
- Next Thread: how to connect with data base add data
Views: 557 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
6 429 2007 access activex add age append application basic beginner birth c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





