Passing parameters to running instance of app

  • Thread starter Thread starter Tosch
  • Start date Start date
T

Tosch

If a user starts a second instance of my application I want to pass
the specified parameters to a already running instance of the
application and the terminate the second instance.

I know how to check if a instance is already running but how do I pass
the parameters?
Parameters are normally be filenames, but could also be some switches
like /a,/b etc.

Thomas
 
Hi,

Environment.GetCommandLineArgs() returns a string array of the
command line arguments.

Ken
 
Hi,

Write the info to the registry. Setup a timer to check for the info.
Delete the info after you are done. Or write the info to a file. Setup a
filesystemwatcher to watch for the file. Delete the file when done.

Ken
------------------
 
That's an idea, I'll try this.

Thomas

Hi,

Write the info to the registry. Setup a timer to check for the info.
Delete the info after you are done. Or write the info to a file. Setup a
filesystemwatcher to watch for the file. Delete the file when done.

Ken
 
Back
Top