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. USB Size [modified]

USB Size [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
10 Posts 4 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
    mirtu
    wrote on last edited by
    #1

    Hi all How to get USb Attached Device Size.

    modified on Thursday, July 31, 2008 6:20 AM

    C I P M 5 Replies Last reply
    0
    • M mirtu

      Hi all How to get USb Attached Device Size.

      modified on Thursday, July 31, 2008 6:20 AM

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      Use this. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      I 1 Reply Last reply
      0
      • M mirtu

        Hi all How to get USb Attached Device Size.

        modified on Thursday, July 31, 2008 6:20 AM

        I Offline
        I Offline
        Iain Clarke Warrior Programmer
        wrote on last edited by
        #3

        Measuring tape? Iain.

        1 Reply Last reply
        0
        • C CPallini

          Use this. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          I Offline
          I Offline
          Iain Clarke Warrior Programmer
          wrote on last edited by
          #4

          I *knew* I should have refreshed the page before answering. Great minds think alike, eh? Iain.

          C 1 Reply Last reply
          0
          • M mirtu

            Hi all How to get USb Attached Device Size.

            modified on Thursday, July 31, 2008 6:20 AM

            P Offline
            P Offline
            Perspx
            wrote on last edited by
            #5

            I assume you mean disk space? If so use the IOCTL_DISK_GET_LENGTH_INFO control code with DeviceIoControl(). The documentation can be found here Hope this helps, --Perspx

            "The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia

            1 Reply Last reply
            0
            • I Iain Clarke Warrior Programmer

              I *knew* I should have refreshed the page before answering. Great minds think alike, eh? Iain.

              C Offline
              C Offline
              CPallini
              wrote on last edited by
              #6

              Iain Clarke wrote:

              Great minds think alike, eh?

              I suppose. :-D [added] BTW: maybe some physics exposure lead to such bents. [/addes]

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              1 Reply Last reply
              0
              • M mirtu

                Hi all How to get USb Attached Device Size.

                modified on Thursday, July 31, 2008 6:20 AM

                M Offline
                M Offline
                mirtu
                wrote on last edited by
                #7

                Sorry i was wrong i just edit the question..

                1 Reply Last reply
                0
                • M mirtu

                  Hi all How to get USb Attached Device Size.

                  modified on Thursday, July 31, 2008 6:20 AM

                  I Offline
                  I Offline
                  Iain Clarke Warrior Programmer
                  wrote on last edited by
                  #8

                  Between my first answer and now, I've had a bit of a look for an answer for you. First - click on my name to go to an article I wrote about detecting drives being added / removed. It may be helpful for you. You've already been told about DEVICE_IO_CONTROL possible solution. The only other function I've found is GetDiskFreeSpaceEx - which doesn't tell you the total size, just the free space. But if free space is good enough information for you, it will be a lot easier to use. Good luck, Iain.

                  M 2 Replies Last reply
                  0
                  • I Iain Clarke Warrior Programmer

                    Between my first answer and now, I've had a bit of a look for an answer for you. First - click on my name to go to an article I wrote about detecting drives being added / removed. It may be helpful for you. You've already been told about DEVICE_IO_CONTROL possible solution. The only other function I've found is GetDiskFreeSpaceEx - which doesn't tell you the total size, just the free space. But if free space is good enough information for you, it will be a lot easier to use. Good luck, Iain.

                    M Offline
                    M Offline
                    mirtu
                    wrote on last edited by
                    #9

                    it is nice but not use full for me..If it is possibel then can you give me example of USB attached device Size.. Thx's

                    1 Reply Last reply
                    0
                    • I Iain Clarke Warrior Programmer

                      Between my first answer and now, I've had a bit of a look for an answer for you. First - click on my name to go to an article I wrote about detecting drives being added / removed. It may be helpful for you. You've already been told about DEVICE_IO_CONTROL possible solution. The only other function I've found is GetDiskFreeSpaceEx - which doesn't tell you the total size, just the free space. But if free space is good enough information for you, it will be a lot easier to use. Good luck, Iain.

                      M Offline
                      M Offline
                      mirtu
                      wrote on last edited by
                      #10

                      can any body help me

                      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