-
Collecting file name
I am trying to write a program to accosiate with zip files. Basically, I want to double click a zip file, have it load up my program and pass it the name of the zip file and then have my program call a batch file passing this data.
I think I can do most of it, but I have no idea how to collect the file name when the program is called from an association.
Anyone have any ideas where to start? Just the name of a function to look at would be great.
Cheers - LinkJames
-
Never mind, I have found out myself. For those interested, its the same as code for taking command line arguments (Why didn't I think of that to start with)
For those interested, this code outputs the name of the program then the name of the program that called it:
Code:
#include <fstream>
#include <iostream>
using namespace std;
int main ( int argc, char *argv[] )
{
cout<<argv[0]<<"\n";
cout<<argv[1]<<"\n";
cin.get();
}