Click here to Skip to main content
15,922,584 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
Hi,

I would like to select several files on my desktop (or any other folder) and pass their names to my application.

More specifically, I've added a key to the registry such that when I right click on a jpeg file I see a new "Transform" option that actually runs my application. The question is how can I pass all selected files names to my application ?

Thanks a lot !
Posted

Doesn't it just happen ? what testing have you done ? I'd expect that once you have this set up, your app will be started once for each selected file, and passed that filename.
 
Share this answer
 
For Windows Forms applications, use Environment.GetCommandLineArgs().
 
Share this answer
 
Actually, I don't know how to get the filenames in my app.
I started a new Windows Form Application project in Visual Studio, and the automatically generated Main() function does not have the "args" parameter. Why ?
 
Share this answer
 
C#
static void Main(string[] args)
{
    // args should be your file names
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900