0

long time reader, first time poster here :)

I'm currently trying to learn how to use interops, and was wondering if i could somehow setup a program (program A) that adds an additional option to a popup-menu in another program (program B).

Edit: Program B is not my program I, so I don't have any direct control over it. Basicly program B is a shelfware program i want to add additional functionality to.

What I want to achieve is the following

  1. User starts program A
  2. User starts program B
  3. User right clicks an object that brings forth a popup-menu (in program B)
  4. User picks option id 6 (in program B)
  5. Program A notices this
  6. Program B brings up another popup menu (in program B)
  7. Program A adds another option to this menu inside program B
  8. Should the user pick this new option, it calls a function in Program A.

Is this even possible to achieve with InterOp?

Nodosano
  • 1
  • 1
  • The question is unclear. InterOp typically refers to COM Interop which is a way to call COM components from .NET. What can be done / invoked to a specific COM component is dependent on the interfaces it defines. Are you asking about creating COM components and using C# to interact with them? If not, what are you asking exactly? What do you mean by InterOp in this question? – user469104 Oct 14 '14 at 21:28
  • is called [Active Document Containment](http://msdn.microsoft.com/en-us/library/6bzz39ft.aspx) – Remus Rusanu Oct 14 '14 at 21:37
  • Hmm, ok maybe i've misunderstood and interops aren't the way to go here. What i want to achieve is to add additional functionality to a program i don't have direct access too(no public APIs). I was under the impression i could trigger an event on certain SendMessage calls in the winAPI to manipulate menus (for example look for WM_CONTEXTMENU calls or something like that) – Nodosano Oct 15 '14 at 06:21
  • if you are using the same programming language for both programs A and B then you do not need Interop at all, if you need to choose a way to somehow communicate between two programs - you can choose the most suitable way from this list http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574%28v=vs.85%29.aspx, if you want to change some UI component in A from B then you simply need to add assembly B as a dependency to A and call one of B methods each time you want to display items in your control – Anonymous Oct 15 '14 at 12:57
  • @Art: Program B is developed using C or C++ as far as i can tell, it is not my program. I'm using C# atm but I'm used to C++ aswell. I have no direct access to program B, so I can't directly call anything in there. After a bit more research i'm starting to suspect that to achieve what i want i'll need to inject a DLL into program B. – Nodosano Oct 16 '14 at 08:21

0 Answers0