Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I need to get the path of all directories which are opened by the user so that I can get all the files and subdirectories which the user may wnat to open and scan them. Can anybody help?

Thanks alot.
Posted
Comments
Andrew Brock 8-Nov-11 2:39am    
Do you mean jut in Windows explorer, or by any program, including cmd.exe and visual studio?
lilyNaz 8-Nov-11 3:48am    
I mean the applications which you can see in windows task manager, but not the processes. I am not looking for cmd.exe, The most important process for me is explorer.exe and I need to retrieve the address of the opened directories that you can see in applications tab of task manager.

 
Share this answer
 
Comments
lilyNaz 8-Nov-11 4:52am    
Well tnx for the link but I didn't find what I was looking for...
epanjohura 8-Nov-11 4:53am    
you're welcome :)
Depending on what you are wanting to do, a shell extension[^] may be the best thing. This will integrate your code directly into Windows Explorer, and allow you to do things such as add a toolbar or a column to the file view.

If you just want to know what they are looking at, without changing the Windows Explorer experience, then this would not be a good way.

This may or may not be the best way, but check out my answer[^] to a similar question a few days ago. Windows Explorer and Internet Explorer are very similar in a lot of respects, this code will find the URL of all Windows Explorer and Internet Explorer windows. If the URL starts with file:// then it is a Windows Explorer window.

As I said, there may be a better way, but since no one has answered yet, I thought I'd give you this.
 
Share this answer
 
Comments
lilyNaz 8-Nov-11 6:13am    
I'll check out your answer.Thank you Andrew
Andrew Brock 8-Nov-11 6:17am    
I forgot to mention that the names are in a valid internet format. This means that a space for example is represented as "%20" (the ascii code for a space is 32, which in hexadecimal is 0x20, hence %20). Some other characters are also in this format, you need to search for the % character and replace the next 2 characters which make up the hexadecimal code for the character with the character. Let me know if you need help with it.
lilyNaz 8-Nov-11 6:39am    
I need to write the code in Embarcadero c++ builder, and I get errors regarding these two lines:
#import MSHTML.TLB
#import SHDOCVW.DLL
Where should I add these two?
Andrew Brock 8-Nov-11 6:56am    
Sorry, they are only supported by Visual Studio. It generates header files from the .tlb and .dll files. These headers then depend on the Windows SDK, and I am not familiar with Embarcadero, but since it is cross platform I suspect it does not support these headers (because that would no longer be cross platform).

You may just have to wait for someone else to make a suggestion.
lilyNaz 9-Nov-11 2:46am    
Do you think that I could use EnumDesktopWindows in order to find the address of all opened windows which may be directories?
I know it doesn't consider all the different ways of opening a directory but Is it possible?

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