Harddisk partitions
-
hello i need to know how could i know how many harddisk drive installed and how many partitions and there names using vc 6.0 thanks
Not sure about getting the # of physical drives, but you can get the drive letters with
GetLogicalDriveStrings()
, then callGetVolumeInformation()
to get the volume names. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas." -- Buffy -
Not sure about getting the # of physical drives, but you can get the drive letters with
GetLogicalDriveStrings()
, then callGetVolumeInformation()
to get the volume names. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas." -- BuffyTCHAR drive[] = "a:\\"; int NoDrives =0; for (int i= 'A';i<'Z';i++) { drive[0] = i; UINT type= GetDriveType (drive); if (type !=DRIVE_NO_ROOT_DIR ) { SHFILEINFO fi; SHGetFileInfo (drive,0,&fi,sizeof (fi),SHGFI_TYPENAME|SHGFI_DISPLAYNAME|SHGFI_SMALLICON|SHGFI_ICON ); // fi.szDisplayName; Partition or drive name // fi.TypeName Type name // fi.hIcon Index of the icon of the drive in the system NoDrives ++; ); }; This should work .
-
TCHAR drive[] = "a:\\"; int NoDrives =0; for (int i= 'A';i<'Z';i++) { drive[0] = i; UINT type= GetDriveType (drive); if (type !=DRIVE_NO_ROOT_DIR ) { SHFILEINFO fi; SHGetFileInfo (drive,0,&fi,sizeof (fi),SHGFI_TYPENAME|SHGFI_DISPLAYNAME|SHGFI_SMALLICON|SHGFI_ICON ); // fi.szDisplayName; Partition or drive name // fi.TypeName Type name // fi.hIcon Index of the icon of the drive in the system NoDrives ++; ); }; This should work .
Er, how is that any different from
GetLogicalDriveStrings()
? and that still doesn't tell you how many physical hard drives are present. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber Actual sign at the laundromat I go to: "No tinting or dying."