Dragging file onto program

This is a discussion on Dragging file onto program within the Windows Programming forums, part of the Platform Specific Boards category; Ok, to simplify it lets go with a toy example. Say I created a program that changes every individual i ...

  1. #1
    ^ Read Backwards^
    Join Date
    Sep 2005
    Location
    Earth
    Posts
    282

    Dragging file onto program

    Ok, to simplify it lets go with a toy example.

    Say I created a program that changes every individual i in a txt file to I.
    But instead of running the program and selecting the file, I want the user to drag the txt file onto the EXE icon (or possible the shortcut?) and it runs the program on that file with default parameters.

    I have no clue how hard this will be, hopefully simple!
    But I do not no where to begin.

    For Windows (XP) but it would be nice if it was universal for Win32.

    *edit* Crap, I clicked the wrong board! I ment to put this in the Windows board. I suck!

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,339
    I think windows does the right thing of running your program with the full pathnames of the files being dropped as command line parameters.
    That's argv[] if you're using consoles

  3. #3
    ^ Read Backwards^
    Join Date
    Sep 2005
    Location
    Earth
    Posts
    282
    Well I'll be, it does. Doh! Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 08:35 AM
  2. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  3. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  4. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

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