Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Harddisk partitions

Harddisk partitions

Scheduled Pinned Locked Moved C / C++ / MFC
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    m badran
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • M m badran

      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

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Not sure about getting the # of physical drives, but you can get the drive letters with GetLogicalDriveStrings(), then call GetVolumeInformation() 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

      C 1 Reply Last reply
      0
      • M Michael Dunn

        Not sure about getting the # of physical drives, but you can get the drive letters with GetLogicalDriveStrings(), then call GetVolumeInformation() 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

        C Offline
        C Offline
        Chernobog1
        wrote on last edited by
        #3

        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 .

        M 1 Reply Last reply
        0
        • C Chernobog1

          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 .

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          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."

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups