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. File System Methods

File System Methods

Scheduled Pinned Locked Moved C / C++ / MFC
c++csharphelpworkspace
8 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.
  • T Offline
    T Offline
    Tom Moore
    wrote on last edited by
    #1

    Hi, I'm trying to write a program that can copy a file URI into any window by drag and drop. The problem lies in C++, so far i've found only two methods: GetLogicalDrives and GetLogicalDriveString. In .NET there is this eqivalent: Environment.GetLogicalDrives and DriveInfo.GetDirectories. Im wondering if there is any eqivalent in Visual C++ Thanks Tom

    D 1 Reply Last reply
    0
    • T Tom Moore

      Hi, I'm trying to write a program that can copy a file URI into any window by drag and drop. The problem lies in C++, so far i've found only two methods: GetLogicalDrives and GetLogicalDriveString. In .NET there is this eqivalent: Environment.GetLogicalDrives and DriveInfo.GetDirectories. Im wondering if there is any eqivalent in Visual C++ Thanks Tom

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      What does a URI have to do with GetLogicalDrives() or GetLogicalDriveString()? How does drag/drop relate to all of this? Please explain what it is that you are after.


      "Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.

      "Judge not by the eye but by the heart." - Native American Proverb

      T 1 Reply Last reply
      0
      • D David Crow

        What does a URI have to do with GetLogicalDrives() or GetLogicalDriveString()? How does drag/drop relate to all of this? Please explain what it is that you are after.


        "Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.

        "Judge not by the eye but by the heart." - Native American Proverb

        T Offline
        T Offline
        Tom Moore
        wrote on last edited by
        #3

        DavidCrow wrote:

        What does a URI have to do with GetLogicalDrives() or GetLogicalDriveString()? How does drag/drop relate to all of this? Please explain what it is that you are after.

        Ok, My app is supposed to display a tree view of the file system, you can then select the file you want. Then you drag a cross hair like in Spy++, to the window and it will copy the absolute path of the file to the location you dragged the crosshair to. I know that can be done without an app been written, but in some windows that don't support drag/drop operations, eg. Lan Connections Screen in Internet Options. Dragging the cross hair over the selected area will retreive the handle of the control and send a WM_PASTE message to that control and paste the file path into the selected window. :) Tom

        D 1 Reply Last reply
        0
        • T Tom Moore

          DavidCrow wrote:

          What does a URI have to do with GetLogicalDrives() or GetLogicalDriveString()? How does drag/drop relate to all of this? Please explain what it is that you are after.

          Ok, My app is supposed to display a tree view of the file system, you can then select the file you want. Then you drag a cross hair like in Spy++, to the window and it will copy the absolute path of the file to the location you dragged the crosshair to. I know that can be done without an app been written, but in some windows that don't support drag/drop operations, eg. Lan Connections Screen in Internet Options. Dragging the cross hair over the selected area will retreive the handle of the control and send a WM_PASTE message to that control and paste the file path into the selected window. :) Tom

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          As soon as you start dragging from your tree control, are you sending a TVN_BEGINDRAG notification message?


          "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

          "Judge not by the eye but by the heart." - Native American Proverb

          T 1 Reply Last reply
          0
          • D David Crow

            As soon as you start dragging from your tree control, are you sending a TVN_BEGINDRAG notification message?


            "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

            "Judge not by the eye but by the heart." - Native American Proverb

            T Offline
            T Offline
            Tom Moore
            wrote on last edited by
            #5

            DavidCrow wrote:

            As soon as you start dragging from your tree control, are you sending a TVN_BEGINDRAG notification message?

            I don't think you understand! You don't drag from the tree view, you drag the crosshair like in Spy++ (See The Window Finder Article) They'd be a cross hair in the bottom of the screen, then when you drag the cross hair onto the window, eg. Textbox , it would copy and paste the file path from the tree view into the window control that you dragged the cross hair. Thanks Tom

            D 1 Reply Last reply
            0
            • T Tom Moore

              DavidCrow wrote:

              As soon as you start dragging from your tree control, are you sending a TVN_BEGINDRAG notification message?

              I don't think you understand! You don't drag from the tree view, you drag the crosshair like in Spy++ (See The Window Finder Article) They'd be a cross hair in the bottom of the screen, then when you drag the cross hair onto the window, eg. Textbox , it would copy and paste the file path from the tree view into the window control that you dragged the cross hair. Thanks Tom

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              So what exactly is the problem? Implementing the crosshair? Figuring out what is selected in a tree control? Setting the text of an edit control?


              "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

              "Judge not by the eye but by the heart." - Native American Proverb

              T 1 Reply Last reply
              0
              • D David Crow

                So what exactly is the problem? Implementing the crosshair? Figuring out what is selected in a tree control? Setting the text of an edit control?


                "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                "Judge not by the eye but by the heart." - Native American Proverb

                T Offline
                T Offline
                Tom Moore
                wrote on last edited by
                #7

                DavidCrow wrote:

                So what exactly is the problem? Implementing the crosshair? Figuring out what is selected in a tree control? Setting the text of an edit control?

                The exact problem is implementing the drag and drop procedure so it works out of the current program, the cross hair needs a function that returns the window handle or control handle, so I can send a WM_PASTE message to the necessary control. Tom

                D 1 Reply Last reply
                0
                • T Tom Moore

                  DavidCrow wrote:

                  So what exactly is the problem? Implementing the crosshair? Figuring out what is selected in a tree control? Setting the text of an edit control?

                  The exact problem is implementing the drag and drop procedure so it works out of the current program, the cross hair needs a function that returns the window handle or control handle, so I can send a WM_PASTE message to the necessary control. Tom

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  Tom Moore wrote:

                  ...the cross hair needs a function that returns the window handle or control handle, so I can send a WM_PASTE message to the necessary control.

                  From the article:* Whenever the mouse moves, get the screen position of the mouse (GetCursorPos())

                  • Get the HWND of the window beneath the mouse (WindowFromPoint())


                    "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                    "Judge not by the eye but by the heart." - Native American Proverb

                  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