开发者

C# Integration into Windows Shell

开发者 https://www.devze.com 2023-01-29 21:45 出处:网络
I am currently in the process of developing an application in C#. I am using WPF forms and using an embedded SQLite Database.

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.


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#.

0

精彩评论

暂无评论...
验证码 换一张
取 消