View Java GUI inside .NET Form / Visual Studio Editor?

My goal is to write a Visual Studio plugin (a VSPackage ) for my Java application. I was wondering if it is possible to view some JPanel inside an instance of System.Windows.Forms or rather like Microsoft.VisualStudio.Editor .

I was thinking about an applet, but I was pretty stuck there ...

Streaming a Swing component as JPEG and displaying it in the form of an applicable idea?

EDIT:

I would be very grateful for the answers that are more yes / no / why should you do this? I thought about how to work this way, so I ask:

A detailed solution to achieve my goal, OR, Good ideas / ideas of what my approach should be, OR, A thorough explanation of why this is impossible to achieve.
+6
source share
1 answer

() Warrior's Way

() Wizard Method

  • Use NPAPI / NPRuntime , as browsers do.
  • Download the Java npjp2.dll plugin.
  • Download your applet.

(X) The decision was:

  • Run the part of the VS plugin written in Java (for example, an applet) with the JVM in another process (standard for Java).
  • Get HWND with FindWindow (Win32 API).
  • Use SetParent (Win32 API) and MoveWindow (Win32 API) to dock the window and resize it.

I could call this the "easiest way", but running Java in another process will give you more stability, so this is the "way that works." My only fear about using a window from another process - a thread that processes Windows messages in Java can interfere with Visual Studio. But from what I see, there is nothing to fear.

:-)

+5
source

Source: https://habr.com/ru/post/949237/


All Articles