Drag and Drop files/Read and write files

This is a discussion on Drag and Drop files/Read and write files within the C Programming forums, part of the General Programming Boards category; Hello everyone, How to make a C program that reads a file when it is dragged over it? (.exe). I'd ...

  1. #1
    Registered User
    Join Date
    Sep 2010
    Location
    Portugal
    Posts
    22

    Wink Drag and Drop files/Read and write files

    Hello everyone,

    How to make a C program that reads a file when it is dragged over it? (.exe).

    I'd also like to know more about writing files with C (links possibly ? ;D).

    Thanks in advance,

    Scout

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    When you drag a file over a program, the pathname to that file is passed to the program as if it were a command-line argument (so you can find it in argv[1]). So you can use that with fopen to open the file.

  3. #3
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,444
    From the tutorials section on this site: Cprogramming.com - Tutorials - C File I/O.

Popular pages Recent additions subscribe to a feed

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