1

In C# .net (desktop application). Now on the right click of the folder or file - after clicking on "send to" -> "mail recipient", I want to open my application. I can do this using dll, I want to make dll in c#. here is snap shot that I want to do - Image is taken from the google - "send to mail recipient" - process behind the task is - after click on mail recipient explorer is making a call to registry, takes dll path, it reads the dll. In the dll there is code which identifies file or folder, generates the path of file or folder and calls the "my mail-application" with parameter which has file or folder path.

For that I made registry entries in which I am giving the address of the path and they are perfect. Now issue is with the dll. I don't know how to create the dll in C#, actually problem is how to specify an entry point in dll using c# code and how to pass file or folder information.

So, my question is on the click of "mail recipient", how to call the function which I have specified in dll? You can also give me a rough idea of how to accomplish this.

Ujjaval Moradiya
  • 222
  • 1
  • 12
  • Possible duplicate of [Pointers for writing context menu items for windows explorer](http://stackoverflow.com/questions/8671865/pointers-for-writing-context-menu-items-for-windows-explorer) – BugFinder Mar 07 '16 at 11:58
  • @BugFinder Context menu that you are talking, IContextMenu will make task done for me - when user right clicks in explorer, the initialize of IContextmenu method will be called first. But I want is, now Context menu is generated and there is an option "Send to" --> "Mail recipient", now when I click on this, explorer calls dll file. If I make dll in c++, I can enter in dll, but with c# dll I am unable to enter in dll. Do you have any suggestion how to do this. At the end I have an alternate option of c++. – Ujjaval Moradiya Mar 10 '16 at 04:34

1 Answers1

0

If you google theres a lot of information out there. Stack overflow does not generally answer such generic broad questions - but, this has been covered many times.. some links you might like

Adding app as a context

Stack over flow questions on this very subject (this one is closed, but it has links to all the others)

Community
  • 1
  • 1
BugFinder
  • 17,474
  • 4
  • 36
  • 51
  • yes there are solutions, but all are in c++ and they have used dll. And about the link "Adding app as a context", I am very well known about that thing. Now the issue is, I want to make a dll in c#, in c++ you can define an entry point using "BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)", so when process is attached to dll this runs automatic, I want to do same c#. That I am unable to do. So can you have solution for this, or you give alternate solution also. – Ujjaval Moradiya Mar 08 '16 at 05:13