PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Multiple calls to USBDetectRemovableStorage
  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
USBDetectRemovableStorage (Function)
In French: USBDétecteStockageAmovible
Detects whether a removable storage unit (CD, USB key, USB camera, ...) was added or removed.
Example
IF USBDetectRemovableStorage("USBProcedure") = False THEN
Error(ErrorInfo())
END
// ----------------------------------------
PROCÉDURE USBProcedure(Letter, Action)
IF Action = RemovableStorageInserted THEN
Info(Letter + ": Inserted")
ELSE
Info(Letter + ": Ejected")
END
Syntax
<Result> = USBDetectRemovableStorage(<Procedure Name>)
<Result>: Boolean
  • True if the detection was performed.
  • False otherwise.
<Procedure Name>: Character string
  • Name of WLanguage procedure that will be run during the detection,
  • Empty string ("") to disable the detection.
This procedure is called whenever a storage unit is inserted or ejected.
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.
Note: If the storage unit triggers the appearance of several drive letters, these ones will be separated by tabulations (<Drive Letter 1> + TAB + <Drive Letter 2> + ... + TAB + <Drive Letter N>).
The <Type of Action> parameter is an integer constant 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 USBDetectRemovableStorage

If this function is run several times with different procedures passed in 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 <Procedure Name> is a procedure local to a window, the detection will stop when the window is closed. We recommend that you use a global procedure.

Limitations

USBDetectRemovableStorage must not be run from a secondary thread.

Equivalence

USBDetectRemovableStorage is equivalent to fDetectRemovableStorage.
Components
WINDEVReports and Queries wd230std.dll
Minimum required version
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment