Getting Paths of Open Explorer Windows

vendiddy

Well-known member
Joined
May 14, 2006
Messages
64
Programming Experience
1-3
Is it possible to retrieve the paths of all open explorer windows?

For example if the folders "A" and "B" are open in explorer. I want to be able to retrieve their paths and display them in a listbox.

I want the user to have the option of selecting a directory that they already have open in windows explorer.

Thanks.
 
Last edited:
It's not ngoing to be easy, and certainly will require API calls to investigate the windows open right now. Your task will be made much easier if you have the option "display full paths in the title bar" ticked in Folder Options, because you can enumerate all windows, and get their window text. Without this option set, you will have to enumerate their child windows looking for the location bar, if it is on show. Without this, I cannot think of a way.

To be honest, I think this is an endeavour that will consume far more of your time than it will deliver real-value to the end user; get on with something more important, and jsut have a simple SaveFileDialog that remembers the users last choice in a particular context..
 
It's just using the 4-5 lines of code in the other thread I posted. Dead easy. ;)
 
Ah, sorry John.. I did look at the other thread, but I assumed that it was only web browsers that I'd created in my program.. I didnt realise that ShDocVw.ShellWindows was effectively a static list of all sheel doc views open on the system, regardless of who started them. Nice find!
 
Back
Top