469,600 Members | 2,393 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,600 developers. It's quick & easy.

Getting selected files from windows explorer

Hi All,

Based on the sample kbbar.net applicaation i have created a tool bar
for windows explorer. Now i have to enable and disable few buttons
based the user slects file in the explorer. For to sync this i have
set-up the connection point as in the following function. I could
to get the events only when the user double cliks a folder in the
explorer treview or list view. If the user slect an item by single
click no notification is recieved from Explorer. Please help me in
this regard.

private void ManageConnection(ConnectType eConnectType)
if (Explorer == null)

// Explorer is nothing but an instance of WebBrowserClass
UCOMIConnectionPointContainer cpc = Explorer as
UCOMIConnectionPointContainer ;
if(cpc != null)
UCOMIConnectionPoint spConnectionPoint;
Guid guid = typeof(SHDocVw.DWebBrowserEvents2).GUID;
cpc.FindConnectionPoint(ref guid, out spConnectionPoint);
if (spConnectionPoint == null)
throw new ArgumentException("COM object does not
support specified source interface");

if (eConnectType == ConnectType.Advise)
spConnectionPoint.Advise(this, out iCookie);
throw new ArgumentException("COM object does not support


Alos I have few questions.

1. The connection point works both in the IE and Windows Explorer.
can i restrict to only Windows explorer.
2. Whether webbrowser class is equivalent to Windows explorer? or
there is any other class for windows explorer.

Thanks for your patientce and help.

Shafeeque O.K.
Dec 25 '07 #1
0 1704

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by harry | last post: by
9 posts views Thread by Brian Henry | last post: by
1 post views Thread by iwdu15 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.