BYTE GetTempDrive(chDriveLetter) | ||||
char chDriveLetter; | /* ignored, */ |
The GetTempDrive function returns a letter that specifies a disk drive the application can use for temporary files.
chDriveLetter
This parameter is ignored.
The return value specifies a disk drive for temporary files if the function is successful. If at least one hard disk drive is available, the function returns the letter of the first hard disk drive (usually C). If no hard disk drives are available, the function returns the letter of the current drive.
The following example uses the GetTempDrive function to determine a suitable disk drive for temporary files:
char szMsg[80];
BYTE bTempDrive;
bTempDrive = GetTempDrive(0);
sprintf(szMsg, "temporary drive: %c", bTempDrive);
MessageBox(hwnd, szMsg, "GetTempDrive", MB_OK);