Click here to Skip to main content
15,914,642 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
When you use a openfiledialog you can add files to your listbox(etc..). What i want is to be able to add files to my application without an openfiledialog. I want to click the file, and want my application to be an option in the SendTo context menu, when i select my application, i want it(the file) to appear in my applications listbox.

Please....Help.
Posted
Updated 28-Oct-11 5:56am
v2
Comments
Sergey Alexandrovich Kryukov 28-Oct-11 11:57am    
Not clear. What should be instead of file dialog? Click the file... where?
--SA
Raidzen10 28-Oct-11 12:01pm    
Ok. Check it, when you select a file in mydocuments and open the send to context menu, i want my application yo be an option, when you select my application, i want the file to be sent to the listbox in my application, the same way it would do if i had used an openfiledialog.

To do that you need to add a shortcut to your application in the AppData\Roaming\Microsoft\Windows\SendTo folder for your user(s). To find out what I mean, use start, run and execute the following:
%APPDATA%\Microsoft\Windows\SendTo
This will open windows explorer in the relevant folder.

You can do this from your setup application - just create an appropriate shortcut in the folder on the user machine.
 
Share this answer
 
Comments
Mehdi Gholam 28-Oct-11 12:09pm    
Simple, 5!
I think what you actually are getting at is to associate files. This has nothing to do with OpenFileDialog.

You will need to do this using Visual Studio Installer Depoloyment[^].

Also you need to handle the passing in of the file. This will come in the object[] args on the entry point of the application. You can then check if you have args or not. In the case you do not, the user simply started the .exe. If you have args it means windows started your .exe via file association.
 
Share this answer
 
v2

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