Display the path and filename when a mouseDown is Fired

delphi package - easy access to shell apis
Post Reply
rionroc
Posts: 6
Joined: Sun May 24, 2009 7:19 pm
Contact:

Display the path and filename when a mouseDown is Fired

Post by rionroc »

Hello Delphi expert Madshi

I don't know where to begin this post, but I hope someone can solve this issue.

Is there a way to get the path and filename when mouseleft is clicked on an active windows explorer or any file manager?

I've tried infoTip, but it only gets when mouseOver.
I've tried ishellexecutehook, but it only gets when mouseDouble clicked.
I've tried dragndrop, but it only gets when a file is drag.

How about when mouse_left is clicked on any file manager or on active windows explorer?

How can I get the path and filename when a selected filename was clicked or mouseleftDown?


Thanks experts!
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

The explorer uses a normal listview control. So you should be able to use the listview messages to read out which item is selected and which content it has. However, this way you will only be able to read out the path if the listview contains it. If the explorer is configured to not show the file paths by default, you will not be able to get the path through the listview messages, I think.

P.S: The listview messages where any text is involved require pointers in the context of the listview's owning process. So you can't just use the messages like that from your own exe on an explorer's listview. You first have to allocate memory in the explorer's memory context. You can use the APIs VirtualAllocEx, ReadProcessMemory and VirtualFree to work around this problem.
Last edited by madshi on Wed May 27, 2009 6:15 pm, edited 1 time in total.
rionroc
Posts: 6
Joined: Sun May 24, 2009 7:19 pm
Contact:

Post by rionroc »

I don't know why nobody can solve this issue, some say it's a very difficult subject, but as I see there are lot's of system that is more than difficult than this.

I know this is easy on delphi.net or ms.net, but it's good to solve on delphi native. But I just can't. I've tried some experts but all they can say is hard and not common.
rionroc
Posts: 6
Joined: Sun May 24, 2009 7:19 pm
Contact:

Post by rionroc »

Ops! sorry Madshi

I'm surprise you've comment and just a few seconds I've click submit also.

Anyway thanks for the reply. Let me read your comments :)
rionroc
Posts: 6
Joined: Sun May 24, 2009 7:19 pm
Contact:

Post by rionroc »

Yes! I've applied what your trying to say.

I got the path and filename from any active windows explorer. (solved)

But the problem is when the address bar of windows explorer is hidden or uncheck, I can't get the path.

And the other problem is when it is run on windows 7, only desktop text/filename could be seen, no path because there is no address bar on windows 7.

Do you have any other options?
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Sorry, don't know how to solve that. It's quite possible that only the explorer itself knows the path and that there's no easy way for you to find out...
rionroc
Posts: 6
Joined: Sun May 24, 2009 7:19 pm
Contact:

Post by rionroc »

:)

Thanks anyway madshi
Post Reply