简体   繁体   English

在C#应用程序中使用3rd party上下文菜单(对于Windows资源管理器)?

[英]Use 3rd party context menu (for Windows Explorer) within a C# application?

Unlike others who wish to add items to the Windows Explorer, I want to display a context menu within my application. 与其他希望将项目添加到Windows资源管理器的人不同,我想在我的应用程序中显示一个上下文菜单。 Now you may be thinking, the class you are looking for is ContextMenu . 现在您可能正在考虑,您正在寻找的类是ContextMenu Let me show you what I am interested in doing. 让我告诉您我感兴趣的事情。 Please excuse the small images... 请原谅小图片...

Here is what I currently have: 这是我目前拥有的:

我当前的上下文菜单

This is what I would like it to be: 这就是我想要的:

我希望它看起来像什么

Let's get the assumptions out of the way. 让我们摆脱这些假设。 I've already detected that the user has TortoiseSVN installed and the item they are selecting is under source control. 我已经检测到用户已安装TortoiseSVN,并且他们选择的项目在源代码控制下。

My research thus far: 到目前为止,我的研究:

Retrieving context menus - This is very useful. 检索上下文菜单 -这非常有用。 This is ac# library for the Windows Explorer (which can retrieve the context menu for a particular folder/file). 这是Windows资源管理器的ac#库(可以检索特定文件夹/文件的上下文菜单)。 However, even when testing out the example, it does not retrieve the TortoiseSVN options. 但是,即使在测试示例时,它也不会检索TortoiseSVN选项。

Another context menu retrieval - Almost identical to the previous link (C# code again). 另一个上下文菜单检索 -与上一个链接几乎相同(再次为C#代码)。 Gets the Windows Explorer context menu minus the TortoiseSVN options. 获取Windows资源管理器上下文菜单减去TortoiseSVN选项。

Process to add context menu - I have just started reading these in-depth posts. 添加上下文菜单的过程 -我刚刚开始阅读这些深入的文章。 The answer may be within this text but it is going to take me some time to get through it. 答案可能在本文中,但要花费我一些时间才能完成。 If I have any luck with these, I will post back an answer. 如果我有这些运气,我会回发答案。

User appears to be able to accomplish this - This appears to be a email group that deals with SVN development. 用户似乎能够完成此任务 -这似乎是处理SVN开发的电子邮件组。 Why post it here? 为什么要在这里发布? Perhaps to prove that this can be done. 也许可以证明这是可以做到的。 To quote: "I'm playing with the TSVN shell context menu. I'm using the IContextMenu.QueryContextMenu (C++ code) method to access TSVN shell context menu and then I'm browsing trough the returned menu." 引用:“我正在使用TSVN Shell上下文菜单。我正在使用IContextMenu.QueryContextMenu (C ++代码)方法访问TSVN Shell上下文菜单,然后通过返回的菜单进行浏览。”

All in all, this seems like it should be a fairly straight forward thing to do and I am just missing one step. 总而言之,这似乎应该是一件相当简单的事情,而我只是缺少了一步。 Any and all suggestions are welcome. 任何和所有建议都欢迎。 Thanks! 谢谢!

Edits: Trying to make better use of tags and a more focused title 编辑:试图更好地利用标签和更具针对性的标题

Hopefully the following will get you started 希望以下内容能帮助您入门

Rather than trying to pull from the Windows Explorer, ultimately I re-implemented the ContextMenu myself. 最终,我没有亲自尝试从Windows资源管理器中拉取,而是重新实现了ContextMenu。 Adding in the direct calls to TortoiseSVN (as previously mentioned). 添加对TortoiseSVN的直接调用(如前所述)。 Not the super elegant solution I wanted but it worked of course! 不是我想要的超级优雅的解决方案,但它当然有效!

I will note that user oefe pointed out that the main issue could have been due to x86 vs x64 (TortoiseSVN was installed as x64 on my development machine). 我将注意到oefe用户指出,主要问题可能是由于x86与x64(在我的开发计算机上,TortoiseSVN作为x64安装的)。 Other users may want to look into that if they try to accomplish a similar task. 如果其他用户尝试完成类似的任务,则可能需要调查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用C#移动或调整第三方程序的窗口大小 - Move or resize the windows of 3rd party programs with c# Windows Phone 8是否支持第三方C#库? - Does Windows Phone 8 support 3rd party C# Libraries? C#第三方申请允许在Skype上 - c# 3rd party application allow on skype c#从任务栏中删除第三方应用程序 - c# remove 3rd party application from taskbar C#和Windows资源管理器上下文菜单? - C# And windows explorer context menu? Windows资源管理器的C#和上下文菜单 - C# and context menu of windows explorer 如何在不使用第三方工具的情况下通过 C# windows 应用程序以编程方式发送电子邮件时禁用 Outlook 安全警告 - How to disable outlook security warning while sending emails programmatically through C# windows application without using 3rd party tools 无法在ASP.NET应用程序中使用第三方DLL,但可以在Windows Forms .NET应用程序中使用 - Unable to use a 3rd party DLL in an ASP.NET application, but works from a Windows Forms .NET application 如何从 C# 应用程序显示 Windows 资源管理器上下文菜单? - How do you show the Windows Explorer context menu from a C# application? 在不使用第三方库的情况下以C#在Windows窗体上显示网络摄像头订阅源 - Display webcam feed on windows form in C# without using 3rd party libraries
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM