I have to start several instances of the application and I have to identify it later somehow.
Is it possible to start instance with some custom TAG so later I can find the instance I need?
Process p = new Process();
// p.TAG = "Guid"; ??????
p.StartInfo.FileName = "path";
p.Start();
UPDATE 1
I start several processes in the LOAD event of WPF app. And sometimes cannot get process Id of the current app. So I am looking for approach to differentiate an instance in some custom way if it is possible...
So the model looks like
ParentApp.exe
----> Sun.exe
----> Moon.exe
ParentApp.exe
----> Sun.exe
----> Moon.exe
And I use LOAD
event of ParentApp.exe to pass to Sun.exe and Moon.exe correct Process ID so later they can able create correct MSMQ and exchange data with ParentApp.exe and also ParentApp.exe could close those apps.
UPDATE 2
May we keep some custom data during application executing here
p.Domain = "mydomain?????";
p.EnvironmentVariables.Add("MY_NEW_VARIABLE", "SOME_TEXT????");
http://blog.gapotchenko.com/eazfuscator.net/reading-environment-variables