GetTempDrive

2.x

  BYTE GetTempDrive(chDriveLetter)    
  char chDriveLetter; /* ignored, */  

The GetTempDrive function returns a letter that specifies a disk drive the application can use for temporary files.

Parameters

chDriveLetter

This parameter is ignored.

Return Value

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.

Example

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);

See Also

GetTempFileName