By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,101 Members | 1,394 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,101 IT Pros & Developers. It's quick & easy.

How to get the directory (folder) on which user has done right click

P: 26
Hello,

I have developed one application, and added it to right click pop-up menu of the folder.

Whenever user right-clicks on folder and selects my application from pop-up menu, I want the path to that folder (on which user has done right click).

I am using Directory.GetCurrentDirectory(), but it gives me path to the parent directory of the user right clicked directory.

How can I get the path to the directory on which user has done right click?

Regards
Abhishek
Feb 23 '09 #1
Share this Question
Share on Google+
5 Replies


P: 26
Hello,

I have developed one application, and added it to right click pop-up menu of the folder.

Whenever user right-clicks on folder and selects my application from pop-up menu, I want the path to that folder (on which user has done right click).

I am using Directory.GetCurrentDirectory(), but it gives me path to the parent directory of the user right clicked directory.

How can I get the path to the directory on which user has done right click?

Regards
Abhishek
Feb 23 '09 #2

tlhintoq
Expert 2.5K+
P: 3,525
Could we see some of the code that you are using to do this? I'm going to bet there is some kind of EventArgument that is being passed that you could take advantage of.

(PS. No need to post the same message twice, one minute apart.)
Feb 23 '09 #3

P: 26
Hello tlhintoq,

Thanks for reply.

Actually I added my application to right click on folder by modifying registry and then i am just using Directory.GetCurrentDirectory() inside constructor, which gives me parent directory of user right clicked directory. That's all I have done.

(PS. I did not post the message two times, may be it accidentally got posted two times)

Regards
Abhishek
Feb 23 '09 #4

tlhintoq
Expert 2.5K+
P: 3,525
I ran across this article/project where the author adds context menu to Windows Explorer in order to pass a folder name as the arguments to his .ZIP file utility. Sounds very much like what you are doing, with a different end application as the recipient of the command. It was built on top of this much simpler project that does not pass an argument but is an easier read to start with.
Feb 23 '09 #5

P: 26
Thank you very much...

I got what i needed.

Thanks again

Regards
Abhishek
Feb 24 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.