ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Multiple calls to fDetectRemovableStorage
  • Procedure local to the window
  • Limitations
  • Equivalence
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
fDetectRemovableStorage (Function)
In french: fDetecteStockageAmovible
Detects whether a removable storage unit (CD, USB key, USB camera, ...) was added or removed.
Example
IF fDetectRemovableStorage("MyProcedure") = False THEN
Error(ErrorInfo())
END
//----------------------------------------
PROCÉDURE Myprocedure(Letter, Action)
IF Action = RemovableStorageInserted THEN
Info(Letter + ": Inserted")
ELSE
Info(Letter + ": Ejected")
END
Syntax
<Result> = fDetectRemovableStorage(<WLanguage procedure>)
<Result>: Boolean
  • True if the detection was performed.
  • False otherwise.
<WLanguage procedure>: Procedure name
  • Name of WLanguage procedure that will be run during the detection. This procedure is called whenever a storage unit is inserted or ejected.
  • Empty string ("") to disable the detection.
This procedure has the following format:
PROCEDURE <Procedure name>(<Drive letter>, <Type of action>)
<Drive letter> is a string used to find out the letter of the drive associated with the storage unit.
<Type of action> is an integer used to find out whether the device was inserted or ejected. This parameter can take one of the following values:
RemovableStorageInsertedA removable storage unit was inserted.
RemovableStorageRemovedA removable storage unit was ejected.
Remarks

Multiple calls to fDetectRemovableStorage

If this function is run several times with different procedures passed as parameter, the last procedure used will replace all the procedures previously called: the first procedures will no longer be called.

Procedure local to the window

If the <WLanguage procedure> is local to a window, the detection will stop when the window is closed. We recommend that you use a global procedure.

Limitations

fDetectRemovableStorage must not be run from a secondary thread.

Equivalence

fDetectRemovableStorage and USBDetectRemovableStorage are equivalent.
Component: wd290std.dll
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 08/22/2022

Send a report | Local help