Boardy
Boardy

Reputation: 36237

C# Integration into Windows Shell

I am currently in the process of developing an application in C#. I am using WPF forms and using an embedded SQLite Database.

I was wondering if it was possible to integrate my program into the windows shell. What I want to be able to do is if a user right clicks on a username or password text field on a website or a piece of software then the right click menu will show options for my program. If the user wants to copy their username from the software I have written then can right click on the field, go to menu 'Retrieve Password Manager Data' > choose the category (software/website) > company names retrieved from the database and then go to copy username or password.

Thanks for your help in this matter.

Upvotes: 1

Views: 621

Answers (1)

Hans Passant
Hans Passant

Reputation: 942358

Integrating a .NET app into the shell without trouble is technically possible since .NET 4.0. Google IContextMenu to find sample C# code that implements the required COM interface. Beware of the difficulty of getting it right, debugging is very unpleasant.

But that's a long way from what you are asking for, the shell extension handler lets you create a menu entry in the context menu for Explorer windows. Text boxes in other apps don't expose a standard extensibility interface like the shell does. It is not quite impossible, it requires injecting code into the app with a windows hook. But you can't write that kind of code in C#.

Upvotes: 1

Related Questions