I want to get the selected file or folder in the active explorer window and then pass it's path to my program,how do I do it? for example I click on x.exe on windows explorer and then press CTRL+SHIFT+X hotkey and do something.I need my program to get this path. I found a C++ solution but I can't figure out a C# solution for this.also I'm building a wpf application.
Asked
Active
Viewed 1,372 times
1
-
This was asked today! see here: http://stackoverflow.com/questions/7220606/how-to-know-selected-file-in-c/7220678#comment-8679171 – Davide Piras Aug 28 '11 at 21:30
-
You didn't get it.I don't want to use any opendialog or anything like it.My program is running in the background.it just captures the selected file path.it doesn't show anything for the user to select. – armin Aug 29 '11 at 11:11
-
I know, see my comments there, I told exactly the same, that OpenDialog has nothing to do with the problem, please read my nswers and comments in there :) – Davide Piras Aug 29 '11 at 11:13
-
I saw your link but it was very poorly commented and I'm a beginner in COM programming.So I need a more direct answer,something I can understand. – armin Aug 30 '11 at 14:28
1 Answers
1
see here: https://stackoverflow.com/questions/7222749
there is already the C# code to find the desktop. This does not solve your exact issue but you can copy a lot of code and see how it works to detect the double click on the desktop :)

Community
- 1
- 1

Davide Piras
- 43,984
- 10
- 98
- 147