Reputation: 33
I created an application that works with another programs console (Game). At the start, I passed some arguments to it and it did work, but I also need to pass arguments to this game while it is running. So far I have a program that whenever I try to pass an argument to the game while it is running, it will launch another instance of this game with the arguments. Thanks for reading.
Upvotes: 1
Views: 755
Reputation: 12847
Applications don't typically behave like that, command line arguments are also known "start up" parameters. What you are asking would require the application to handle some kind of IPC (Net Remoting or WCF via Namedpipes etc...) and that is not typical for command line based arguments. So in other words you'd have to write it.
If you don't control the gaming software then you are most likely out of luck. But if you do control the source then you'd need to learn about Mutex
to determine if there is already an instance running and then send a message via Remoting (most likely) to a listener on the game.
Upvotes: 3