By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,454 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,454 IT Pros & Developers. It's quick & easy.

Getting selected files from windows explorer

P: n/a
Hi All,

Based on the sample 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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.