Programmatically Register and Unregister Shell Verbs

  • Thread starter Thread starter godshiva
  • Start date Start date
G

godshiva

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)
 
I wrote an article that shows how toprogrammaticallyregisterfile types
andverbs. This might cover the majority of what you need to do.

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

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top