msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to automate Windows Explorer

 
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE Automation
Author Message
Jim Walsh



Joined: 04 Oct 2007
Posts: 2

PostPosted: Thu Jul 05, 2007 6:24 pm    Post subject: How to automate Windows Explorer Reply with quote

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
View user's profile Send private message
Kyle Alons



Joined: 04 Oct 2007
Posts: 1

PostPosted: Thu Jul 05, 2007 9:26 pm    Post subject: Re: How to automate Windows Explorer Reply with quote

"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
View user's profile Send private message
G Himangi



Joined: 04 Oct 2007
Posts: 3

PostPosted: Fri Jul 06, 2007 1:17 pm    Post subject: Re: How to automate Windows Explorer Reply with quote

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
View user's profile Send private message
Sheng Jiang[MVP]



Joined: 04 Oct 2007
Posts: 2

PostPosted: Fri Jul 06, 2007 4:08 pm    Post subject: Re: How to automate Windows Explorer Reply with quote

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
View user's profile Send private message
Jim Walsh



Joined: 04 Oct 2007
Posts: 2

PostPosted: Fri Jul 06, 2007 8:16 pm    Post subject: RE: How to automate Windows Explorer Reply with quote

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
View user's profile Send private message
Jason S



Joined: 04 Oct 2007
Posts: 1

PostPosted: Mon Jul 09, 2007 10:14 am    Post subject: Re: How to automate Windows Explorer Reply with quote

On Jul 6, 7:16 pm, Jim Walsh
wrote:
> Does anyone have any good references for these libraries?

Look up IShellFolder, IShellView, IShellBrowser etc.

This is one area where the MSDN docs actually seem to be useful. Some
of the following are probably not quite what you want (what are you
trying to do?), but it probably helps to see the big picture:
http://msdn2.microsoft.com/en-US/library/aa969388.aspx
http://msdn2.microsoft.com/en-us/library/aa289172(vs.71).aspx
http://www.codeproject.com/shell/explorer.asp
http://www.codeproject.com/shell/shellextguide1.asp
http://msdn2.microsoft.com/en-us/library/ms632479.aspx
Back to top
View user's profile Send private message
Chris Becke



Joined: 04 Oct 2007
Posts: 1

PostPosted: Mon Jul 09, 2007 7:55 pm    Post subject: Re: How to automate Windows Explorer Reply with quote

"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
View user's profile Send private message
Magnus



Joined: 04 Oct 2007
Posts: 2

PostPosted: Mon Jul 09, 2007 11:21 am    Post subject: Re: How to automate Windows Explorer Reply with quote

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
View user's profile Send private message
Karl E. Peterson



Joined: 04 Oct 2007
Posts: 4836

PostPosted: Mon Jul 09, 2007 2:26 pm    Post subject: Re: How to automate Windows Explorer Reply with quote

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
View user's profile Send private message
Sheng Jiang[MVP]



Joined: 04 Oct 2007
Posts: 2

PostPosted: Mon Jul 09, 2007 6:25 pm    Post subject: Re: How to automate Windows Explorer Reply with quote

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
View user's profile Send private message
Magnus



Joined: 04 Oct 2007
Posts: 2

PostPosted: Mon Jul 09, 2007 6:04 pm    Post subject: Re: How to automate Windows Explorer Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Related Topics:
Automate VB6 I'm creating an add-in to vb6 I can create toolbars menus but no windows like Property Window I've been reading help files for days now but can find a way In the help files it says the property window is a commandBar How is such a commandbar created. If i

automate excel in vb6 Does anyone have some sample code of how to open an excel spreadsheet, edit some cells and then print, and then close it from vb6? -32maple

Possible to automate Powerpoint within a VB executable progr Hi! I have written a VBA macro in my Powerpoint file. I want to write a Visual Basic standalone program that will load Powerpoint and automatically run this macro. Does anyone know if this is doable? Any sample code fragment will be appreciated. Thanks fo

Automate office document imaging 2003 hi, I automate office document imaging in a vb.net application in order to obtain the ocr's result on a given tiff file. Everything is ok except that after my subroutine I got a lock on my tiff file and I can't move or delete the file. thanks for your hel

Automating Internet Explorer Hello net friends, I need to automate Internet Explorer in a very simple way. I need to: 1. press refresh (F5) on the currently loaded website. 2. press END button. 3. Click a button somewhere on the screen with the mouse left button (I'm not sure this b
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group