Link to home
Start Free TrialLog in
Avatar of dodgerfan
dodgerfanFlag for United States of America

asked on

C# : capturing the file and path of a file when right I right click on the file

I am developing a windows application with c#. I need to get the file and folder name when I right click on a file to use for other functions. Right now I have made the registry keys to get my application running. When I right click on a file (word, ppt, txt, etc) my context menu shows the option I added, Set Perm. When that is selected my windows application opens up. In a text box on the form, I want to display the full file name and path. Is there a way to do that? I've added %0 and %1 in the registry to the end of the argument to launch my app, but it does not work. I've tried h:\temp\myapp.exe %1 and h:\temp\myapp.exe %0. Putting the %1 or %0 in quotes did not change anything. I am in Windows 8 using Visual Studio 2017. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Misha
Misha
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dodgerfan

ASKER

I was calling code to pull that name from the wrong event. Once I got it to the right event, it fires correctly and shows the file name and ful path. Thanks.