Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

Programmatically Register and Unregister Shell Verbs

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
godshiva@gmail.com - 30 Mar 2008 07:42 GMT
Hello!

I am designing a simple application to backup files.   I would like to
offer right click windows explorer shell integration to queue files
for backup, or to select files and backup immediately.  This is
similar to the behavior of "Shell integration" options for WinRar or
Winzip.

I am doing this in C#, Visual Studio Express 2005.  I use it because
it is free, and already have written a few applications in 2005, which
is the only reason I have not upgraded to 2008.

I found this - http://msdn2.microsoft.com/en-us/library/bb776820.aspx
which explains basically what I would like to do, but it doesn't offer
any information on the code to use to add things into the registry.

When I look for existing samples on the web, the only source I can
find is people using "COM objects" which, as far as I can see is just
a more complicated method to accomplish the same thing.

It seems like the only drawback is that I am going to be forced to
have a different instance of my application loaded for each selected
file (this only applies if more than one file is selected)  I think I
can avoid this problem by detecting multiple instances through some
sort of global hook

My questions are:
1 - Am I making a mistake trying to avoid using "COM"?
2 - (If Not on #1) where can I find an example of registering this
action inside C# code?

As always, I am open to any comments.

I'm not sure if it is relevant, but I am using an access database to
store the information.  It seems like using a database at all might be
overkill, but I think if I keep adding more data it will actually make
handling of data easier.

Cheers,
Alex (Luc)
BlackWasp - 30 Mar 2008 09:18 GMT
I wrote an article that shows how to programmatically register file types
and verbs.  This might cover the majority of what you need to do.

http://www.blackwasp.co.uk/ProgrammaticFileTypes.aspx

Signature

BlackWasp
www.blackwasp.co.uk

> Hello!
>
[quoted text clipped - 36 lines]
> Cheers,
> Alex (Luc)
godshiva@gmail.com - 31 Mar 2008 00:31 GMT
> I wrote an article that shows how toprogrammaticallyregisterfile types
> andverbs.  This might cover the majority of what you need to do.
[quoted text clipped - 49 lines]
> > Cheers,
> > Alex (Luc)

Cool.

Your note on Vista made me take pause.

I think, that I may just rely on the installer to make my
associations.

I'm also considering having a separate application to take the queue
suggestions, particularly if they will each be invoking another
instance of the application.

That's the problem with doing things a first time - I never know where
it's going, the right way, or even a good way to do it ;)

Thanks though - your example does indeed show how to write to the
registry.  Thank you.

--
Cheers,
Alex (Luc)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.