Click here to Skip to main content
15,915,873 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello everyone

Is it possible to obtain complete path name using mouse click i.e when i click on a file say file.txt on c:\ i shld get the result as c:\file.txt. Any other ways of getting file name other than mouse click.

Please help i am struck with this ....

thank you
Posted
Comments
Sergey Alexandrovich Kryukov 16-Aug-11 23:56pm    
Click where? There is no such thing as "click on file". A file is not a UI element.
--SA

Thank you .... one more doubt... is it possible to obtain path of active window.... like suppose i have opened some file say somefile.txt ... can i obtain path of this.... shell extension is the only way???
 
Share this answer
 
You have to use these Windows APIs: GetForegroundWindow() and GetWindowThreadProcessId().And here is a small working sample code in C# which shows how to use them to obtain path to currently active window.
 
Share this answer
 
v2
You want to write a shell extension. I am assuming the user is clicking in the file system. If not, then there's no way to find the file easily and quickly based on a random filename, or know which file of the same name to show.
 
Share this answer
 
i had made me a little program or script putting into the 'SendTo' folder. that will copy the filename sent to it on scrap (clipboard).
regards.
 
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