Get FilePath of Windows Explorer Context Menu (Right-click menu) to Java

let's suppose that I have created and added a new entry to the Windows explorer right-click menu (context menu) by adding a registry entry that points to a .exe written in C++ that just reads and returns the filename of the clicked file.

Is it possible to get this filename to an already running Java app?

I thought of using JNI but is it possible to call a method of an already running Java app from a native C++ program?

Does anybody have another idea how to solve this? Is it possible to have a pure Java solution?

Many thanks.

Edit: Is it possible to call an existing method of an already running JVM? Then I could create a C++ program that listen for right-clicks and register that .exe with a registry entry for the contextmenu. Inside the C++ program, I could call a dll that injects into an already running JVM. The dll could call a Java method and commits the clicked filepath to Java. Would that be a possibility?


You could connect to an already running Java program through a socket connection, or store values to a database of some kind that both your C++ application and Java application can access.

Besides my suggestions, here's a stackoverflow post that talks about communicating to a Java program already running without the Java program making the initial communication.

Need Your Help

Rails 3.1 Application does not automatically update div

ruby ruby-on-rails-3 jquery ruby-on-rails-3.1

I have a Rails 3.1 application where the view has the following link: