How to run an already running Windows-based Windows application?

I have a .NET-based Windows application that runs in memory. I want to call one of the functions in an application from an external application that is not based on .net. How can i achieve this? The trigger must be in real time.

+4
source share
6 answers

Make the first application listen on the TCP port. Make the second application connect to the TCP port and send "WAKE UP LAZY PROGRAM". Make the first app to answer this by doing something.

+3
source

Using sockets will work. Named pipes will also work.

+2
source

If the program was not .net, I would suggest sending or placing a window message: see PostMessage and RegisterWindowMessage . To get such a message in a .net program, I think you might need PInvoke RegisterWndowMessage and override your WndProc .

Another good opportunity is to share a named mutex.

You have to define what you mean by “real time”: on the one hand, there is nothing in real time on Windows, and on the other hand, when you start to backtrack on it and instead say “almost real time” or “soft” real time, "then many solutions are possible.

+2
source

You cannot send an XML message string to a .net application that is listening on a specific port from a non.net application. By parsing this XML message, you can call a specific function in a .net application.

Wild guess.

thanks 123Developer

0
source

Messaging is probably the way to go. Using sockets will work, but

a) may expose security vulnerabilities and

b) there may be a problem with the firewall software on some machines.

0
source

CodeProject has a sample using .NET Remoting / IPC:

Single-instance application passing command line arguments

0
source

All Articles