8

Unlike others who wish to add items to the Windows Explorer, I want to display a context menu within my application. Now you may be thinking, the class you are looking for is ContextMenu. Let me show you what I am interested in doing. Please excuse the small images...

Here is what I currently have:

My current context menu

This is what I would like it to be:

What I'd like it to look like

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.

My research thus far:

Retrieving context menus - This is very useful. This is a c# library for the Windows Explorer (which can retrieve the context menu for a particular folder/file). However, even when testing out the example, it does not retrieve the TortoiseSVN options.

Another context menu retrieval - Almost identical to the previous link (C# code again). Gets the Windows Explorer context menu minus the TortoiseSVN options.

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

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

Community
  • 1
  • 1
techvice
  • 1,315
  • 1
  • 12
  • 24
  • I've been trying to look at different reasons why the TortoiseSVN context menu isn't showing up when using the 2 open source C# projects that act like a Windows Explorer. What I realized recently is that while TortoiseSVN doesn't show up, other 3rd party tools do (Beyond Compare for example). I originally believed that perhaps there were differences in the registry keys that played a part of this. I haven't found any success in that observation (TSVN was in all of the same registry locations as BC). I'm starting to wonder if this is really just a TortoiseSVN problem. Will update as I get more. – techvice Apr 15 '13 at 23:33
  • Please explain why the .net class ContextMenu wont work. – PeterM Aug 26 '13 at 23:41
  • If you specifically want to use TortoiseSVN, you can call it directly: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html – oefe Oct 19 '13 at 17:33
  • 1
    Is it perhaps a 32 bit vs. 64 bit issue? – oefe Oct 19 '13 at 17:36
  • @PeterM You have misunderstood the question. Yes, a ContextMenu is what is essentially being used but I wanted to incorporate specific items from the Windows Explorer context menu without having to reproduce them myself. – techvice Oct 24 '13 at 20:16
  • @oefe A good question. Unfortunately I can't explore deeper into it (I'm no longer involved in the project). But that is I hadn't considered and I know I had x64 installed whereas other third party tools were x86. I bet you are onto something there... – techvice Oct 24 '13 at 20:18

2 Answers2

0

Hopefully the following will get you started

Community
  • 1
  • 1
Patrick D'Souza
  • 3,491
  • 2
  • 22
  • 39
  • Not helpful. All you did was show links that are easily findable within stackoverflow.com. Also, the links that you listed essentially boil down to the links I have already provided. – techvice Apr 17 '13 at 15:07
0

Rather than trying to pull from the Windows Explorer, ultimately I re-implemented the ContextMenu myself. Adding in the direct calls to TortoiseSVN (as previously mentioned). 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). Other users may want to look into that if they try to accomplish a similar task.

techvice
  • 1,315
  • 1
  • 12
  • 24