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. Or say if i have opened the file and the file is my active window how to get the path of this file. Please give some idea on which api to use and how ?

Please help i am struck with this ....

thank you

You can start here.

You can start here.

Thx .... the solution works if i know the filename,..... in my scenario i dont know what the file name.... i just click on file highlighting it, i shld get the complete path and read the contents of it .... the user can click on any file .... so my application shld dynamically get the file name ...

in my scenario i dont know what the file name....

Of course you know the file name, how else are you displaying it and highlighting it?

Sounds as if he is writing a GUI program and calling win32 api GetOpenFileName() standard dialog box. If that is the case then that dialog box will return the full path in the structure you pass to it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.