|
| Author |
Message |
Jim Walsh
Joined: 04 Oct 2007 Posts: 2
|
Posted: Thu Jul 05, 2007 6:24 pm Post subject: How to automate Windows Explorer |
|
|
I'm developing an application in which I want to let the user browse files
and folders on the hard drive. Since Windows Explorer already does this so
well, I would like to see how I might use Windows Explorer's functionality
via automation.
Could someone suggest some documentation that would point me in the right
direction to implement this?
Thanks,
Jim
Archived from group: microsoft>public>platformsdk>shell |
|
| Back to top |
|
 |
Kyle Alons
Joined: 04 Oct 2007 Posts: 1
|
Posted: Thu Jul 05, 2007 9:26 pm Post subject: Re: How to automate Windows Explorer |
|
|
"Jim Walsh" wrote in message @microsoft.com...
> I'm developing an application in which I want to let the user browse files
> and folders on the hard drive. Since Windows Explorer already does this so
> well, I would like to see how I might use Windows Explorer's functionality
> via automation.
>
> Could someone suggest some documentation that would point me in the right
> direction to implement this?
>
Why not just have the user use Explorer itself?
--
---------------------------------------------------
Automate your software builds with Visual Build Pro
http://www.visualbuild.com/ |
|
| Back to top |
|
 |
G Himangi
Joined: 04 Oct 2007 Posts: 3
|
Posted: Fri Jul 06, 2007 1:17 pm Post subject: Re: How to automate Windows Explorer |
|
|
I don't know if there is a way to automate Windows Explorer, but assuming
you want to integrate a file/folder browsing UI inside your own app, you can
take a look at Shell MegaPack suite of components from http://www.ssware.com
Mind you, they are commercial products.
"Jim Walsh" wrote in message @microsoft.com...
> I'm developing an application in which I want to let the user browse files
> and folders on the hard drive. Since Windows Explorer already does this so
> well, I would like to see how I might use Windows Explorer's functionality
> via automation.
>
> Could someone suggest some documentation that would point me in the right
> direction to implement this?
>
> Thanks,
> Jim
> |
|
| Back to top |
|
 |
Sheng Jiang[MVP]
Joined: 04 Oct 2007 Posts: 2
|
Posted: Fri Jul 06, 2007 4:08 pm Post subject: Re: How to automate Windows Explorer |
|
|
you may want to take a look at
www.codeproject.com/shell/AutomateShellWindow.asp
though I am not sure think trick works on Vista or not
--
Sheng Jiang
Microsoft MVP in VC++
"Jim Walsh" wrote in message@microsoft.com...
> I'm developing an application in which I want to let the user browse files
> and folders on the hard drive. Since Windows Explorer already does this so
> well, I would like to see how I might use Windows Explorer's functionality
> via automation.
>
> Could someone suggest some documentation that would point me in the right
> direction to implement this?
>
> Thanks,
> Jim
> |
|
| Back to top |
|
 |
Jim Walsh
Joined: 04 Oct 2007 Posts: 2
|
Posted: Fri Jul 06, 2007 8:16 pm Post subject: RE: How to automate Windows Explorer |
|
|
Follow-up to my original posting:
I looked at EXPLORER.EXE with the VS6 DEPENDS tool. I can see that EXPLORER
takes advantage of COM, using COM components from SHELL32.DLL, BROWSEUI.DLL,
and SHDOCVW.DLL. Interestingly, Internet Explorer also uses the latter two
libraries too.
Seems like the automation objects I am looking for might be in those
libraries.
Does anyone have any good references for these libraries?
Thanks,
Jim
"Jim Walsh" wrote:
> I'm developing an application in which I want to let the user browse files
> and folders on the hard drive. Since Windows Explorer already does this so
> well, I would like to see how I might use Windows Explorer's functionality
> via automation.
>
> Could someone suggest some documentation that would point me in the right
> direction to implement this?
>
> Thanks,
> Jim
> |
|
| Back to top |
|
 |
Jason S
Joined: 04 Oct 2007 Posts: 1
|
|
| Back to top |
|
 |
Chris Becke
Joined: 04 Oct 2007 Posts: 1
|
Posted: Mon Jul 09, 2007 7:55 pm Post subject: Re: How to automate Windows Explorer |
|
|
"Jim Walsh" wrote in message @microsoft.com...
> I'm developing an application in which I want to let the user browse files
> and folders on the hard drive. Since Windows Explorer already does this so
> well, I would like to see how I might use Windows Explorer's functionality
> via automation.
You can't. Explorer.exe is not an automation server.
> Could someone suggest some documentation that would point me in the right
> direction to implement this?
SHBrowseForFolder is the simplest way to let the user choose a folder.
SHGetOpenFileName lets the user choose a file.
To actually show a treeview / listview like explorer you will need to start
with
SHGetDesktopFolder, and use the members of the returned IShellFolder
interface to populate your treeview and listviews.
If you really desperately want host explorers view, you can get it by
calling IShellFolder::CreateViewObject and asking for the IShellView object.
Invoked correctly this will instantiate the shells view window. It does
however have certain expectations of its environment - there are a number of
interfaces your app will need to support. |
|
| Back to top |
|
 |
Magnus
Joined: 04 Oct 2007 Posts: 2
|
Posted: Mon Jul 09, 2007 11:21 am Post subject: Re: How to automate Windows Explorer |
|
|
On 9 Juli, 15:55, "Chris Becke" wrote:
>
> If you really desperately want host explorers view, you can get it by
> calling IShellFolder::CreateViewObject and asking for the IShellView object.
> Invoked correctly this will instantiate the shells view window. It does
> however have certain expectations of its environment - there are a number of
> interfaces your app will need to support.
If you are only targeting Vista hosting the explorer browser is a bit
easier with IExplorerBrowser.
http://msdn2.microsoft.com/en-us/library/ms645992.aspx
/Magnus |
|
| Back to top |
|
 |
Karl E. Peterson
Joined: 04 Oct 2007 Posts: 4836
|
Posted: Mon Jul 09, 2007 2:26 pm Post subject: Re: How to automate Windows Explorer |
|
|
Magnus wrote:
> If you are only targeting Vista ...
Who, in their right mind, would even contemplate such a thing?
Curious...
--
..NET: It's About Trust!
http://vfred.mvps.org |
|
| Back to top |
|
 |
Sheng Jiang[MVP]
Joined: 04 Oct 2007 Posts: 2
|
Posted: Mon Jul 09, 2007 6:25 pm Post subject: Re: How to automate Windows Explorer |
|
|
Actually IE takes a pidl as a valid address, so you can navigate to a folder
using the IWebBrowser2:: Navigate2 Method.
IE also supports the SID_STopLevelBrowser service, which support
IWebBrowser2 AND IShellBrowser. You can use IShellBrowser::BrowseObject to
browse to a folder, IShellBrowser::QueryActiveShellView to query the actiev
shell view, and use IShellView::SelectItem to select an item. You need to
wait for the DWebBrowserEvents2::DocumentComplete event for the shellview to
be ready. --
Sheng Jiang
Microsoft MVP in VC++
"Jim Walsh" wrote in message@microsoft.com...
> Follow-up to my original posting:
>
> I looked at EXPLORER.EXE with the VS6 DEPENDS tool. I can see that
EXPLORER
> takes advantage of COM, using COM components from SHELL32.DLL,
BROWSEUI.DLL,
> and SHDOCVW.DLL. Interestingly, Internet Explorer also uses the latter two
> libraries too.
>
> Seems like the automation objects I am looking for might be in those
> libraries.
>
> Does anyone have any good references for these libraries?
>
> Thanks,
> Jim
>
>
> "Jim Walsh" wrote:
>
> > I'm developing an application in which I want to let the user browse
files
> > and folders on the hard drive. Since Windows Explorer already does this
so
> > well, I would like to see how I might use Windows Explorer's
functionality
> > via automation.
> >
> > Could someone suggest some documentation that would point me in the
right
> > direction to implement this?
> >
> > Thanks,
> > Jim
> > |
|
| Back to top |
|
 |
Magnus
Joined: 04 Oct 2007 Posts: 2
|
Posted: Mon Jul 09, 2007 6:04 pm Post subject: Re: How to automate Windows Explorer |
|
|
On Jul 9, 7:26 pm, "Karl E. Peterson" wrote:
> Magnus wrote:
> > If you are only targeting Vista ...
>
> Who, in their right mind, would even contemplate such a thing?
>
Beats me, it is easier to host the browser there though.
|
|
| Back to top |
|
 |
|