Windows Shell Integration using .NET

后端 未结 1 1655
野的像风
野的像风 2020-12-18 05:49

What\'s the easiest/best way to register your program in explorers right-click menu using .NET and C#?
i.e. I would like to be able to right-click on an item in windows

相关标签:
1条回答
  • 2020-12-18 06:19

    If you just want to add menu items, then a shell extension is overkill. You can register a command line in the registry which will run your exe with the selected file(s) as the parameter. Shell extensions are really only required if you want to change explorer's behavior, add custom icons, or hook shell based file operations.

    http://www.codeproject.com/KB/shell/SimpleContextMenu.aspx

    If a shell extension is what you need, you're best writing a thin wrapper in unmanaged code that calls out to another process that is your .NET application through some sort of cross process communication channel. Due to all the potential versioning issues, it's not recommended to load the .NET runtime into the explorer process.

    0 讨论(0)
提交回复
热议问题