Group: Shell Lightweight Utility APIs -- Path Functions - Library: shlwapi
Searches a path for a drive letter within the range of "A" to "Z" and returns the corresponding drive number.
Using Path functions from Shell Lightweight Utility APIs (shlapi.dll)
int PathGetDriveNumber(
LPCTSTR lpsz
); DECLARE INTEGER PathGetDriveNumber IN shlwapi;
STRING lpsz lpsz [in] Pointer to a null-terminated string of maximum length MAX_PATH that contains the path to be searched.
Returns 0 through 25 (corresponding to "A" through "Z") if the path has a drive letter, or -1 otherwise.
Home