User Tools

Site Tools


ejecting_20a_20removable_20disk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ejecting_20a_20removable_20disk [2018/03/31 13:19]
127.0.0.1 external edit
ejecting_20a_20removable_20disk [2018/04/17 16:00] (current)
tbest3112 Added syntax highlighting
Line 2: Line 2:
  
 //by Richard Russell, November 2007//\\ \\  The routine listed below will eject a disk (if any) in the specified drive; it requires **Windows NT4**, **Windows 2000**, **Windows XP** or **Windows Vista**. It should be called using code similar to the following:​\\ \\  //by Richard Russell, November 2007//\\ \\  The routine listed below will eject a disk (if any) in the specified drive; it requires **Windows NT4**, **Windows 2000**, **Windows XP** or **Windows Vista**. It should be called using code similar to the following:​\\ \\ 
 +<code bb4w>
         IF FNeject("​D:"​) THEN         IF FNeject("​D:"​) THEN
           PRINT "Eject succeeded"​           PRINT "Eject succeeded"​
Line 7: Line 8:
           PRINT "Eject failed"​           PRINT "Eject failed"​
         ENDIF         ENDIF
 +</​code>​
 The specified drive name must include the colon (**:**). Note that it is possible for the routine to return FALSE even though the disk was actually ejected. If the drive is currently in use by another application the routine will fail.\\ \\  Here is the code:\\ \\  The specified drive name must include the colon (**:**). Note that it is possible for the routine to return FALSE even though the disk was actually ejected. If the drive is currently in use by another application the routine will fail.\\ \\  Here is the code:\\ \\ 
 +<code bb4w>
         DEF FNeject(drive$)         DEF FNeject(drive$)
         LOCAL hVolume%, ejectSucceeded%,​ result%         LOCAL hVolume%, ejectSucceeded%,​ result%
Line 86: Line 89:
         \                      ^dwBytesReturned%,​ 0 TO result%         \                      ^dwBytesReturned%,​ 0 TO result%
         = result%         = result%
 +</​code>​
ejecting_20a_20removable_20disk.txt ยท Last modified: 2018/04/17 16:00 by tbest3112