Open file by drag and drop

This is a discussion on Open file by drag and drop within the C Programming forums, part of the General Programming Boards category; Hi, I'm writing a program that basically reads some data from a file, processes it, then outputs to another file. ...

  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    230

    Open file by drag and drop

    Hi,
    I'm writing a program that basically reads some data from a file, processes it, then outputs to another file.
    When openning files, I always depended on 1 thing: The file is in the same directory. The user simply types in the file name, so the program searches in the same directory of the program*.

    I want to make it easier to open files, and even open up the opportunity to open multiple files in the same execution (not at the same time of course).
    If I use the simple method mentioned above, the user will have to put all the files in the same directory*, and he will have to type all there names which is a big hassle.

    So I experimented a little with arguments. I figured out that when you drop a file on the program executable (the actual file), the file name is passed as an argument.
    However, this is a bit unusual. I personally have never seen a program that does that, and it may confuse many users.

    So I was wondering if there was a way to input a file by drag and drop. There's no problem with time, I need it at a specific time only - not all the time.

    By the way, I'm running windows. I think this information is needed, since the problem sounds system specific.

    Thanks


    *unless the whole path is input, which is not at all efficient.

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    so dnd uses the command args. so? what's the problem with that?

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    230
    (I'm assuming you mean cmd for dnd)

    It just feels different. When opening a file from a program, It's not usual to drag the file onto the program's executable file. It feels much more familiar when dropping it into the open window.

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    oh I see. I misunderstood the question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Drag n' Drop 'any file'
    By Oldman47 in forum C++ Programming
    Replies: 14
    Last Post: 12-19-2006, 04:33 PM
  2. DataGrid drag and drop
    By gtriarhos in forum C# Programming
    Replies: 0
    Last Post: 10-11-2005, 12:36 PM
  3. Drag and Drop using CImageList, Device contexts and BitBlt
    By MJWhiteman2 in forum Windows Programming
    Replies: 0
    Last Post: 03-03-2005, 06:22 AM
  4. drag and drop
    By depsypher in forum Windows Programming
    Replies: 2
    Last Post: 01-05-2002, 09:02 PM
  5. Replies: 4
    Last Post: 10-06-2001, 03:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21