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. Detecting PC peculiarity (vol of disk C ecc..)

Detecting PC peculiarity (vol of disk C ecc..)

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
2 Posts 2 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.
  • N Offline
    N Offline
    nencini
    wrote on last edited by
    #1

    I need a C/C++ program able to detect some peculiarity of the PC (as the number of the partitions of the hard disk, the number and the label of the disk C, ecc.) if it is possible without calling the "system" statement (calling the "system" statement I see alwais the DOS window). Can you help me ????? - I work with Visual C++ compiler. Many thanks - Giovanni

    M 1 Reply Last reply
    0
    • N nencini

      I need a C/C++ program able to detect some peculiarity of the PC (as the number of the partitions of the hard disk, the number and the label of the disk C, ecc.) if it is possible without calling the "system" statement (calling the "system" statement I see alwais the DOS window). Can you help me ????? - I work with Visual C++ compiler. Many thanks - Giovanni

      M Offline
      M Offline
      Mike Nordell
      wrote on last edited by
      #2

      This depends on your target OS. For both Win9x and NT-kernel based Win32 implementations you can: To get the drive letters mapped: GetLogicalDrives() and/or GetLogicalDriveStrings(). To get the label of a volume (note: there is no label for a disk) you can use GetVolumeInformation(). For NT only you can get disk information (partitions and so on) using DeviceIoControl() with e.g. IOCTL_DISK_GET_DRIVE_LAYOUT. To get the same info from Win9x I believe you have to resort to BCB (DOS, anno 1982) and 16-bit code, but I might be wrong. If you want to get the GUID's of volumes (introduced in NT5) you can get to them using NT5+ only API's such as FindFirstVolume. Also, there is no C or C++ "statement" called "system". system() is a C library function. ++luck;

      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