By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,685 Members | 1,326 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,685 IT Pros & Developers. It's quick & easy.

Passing parameters to running instance of app

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi,

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

Ken
------------------------
"Tosch" <to**********@swissonline.ch> wrote in message
news:o8********************************@4ax.com...
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

Nov 20 '05 #2

P: n/a
Ken,

I know that, but how do I pass this to the first instance of the
app???

Thomas
On Sun, 5 Oct 2003 11:44:30 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

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

Ken
------------------------
"Tosch" <to**********@swissonline.ch> wrote in message
news:o8********************************@4ax.com.. .
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


Nov 20 '05 #3

P: n/a
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
------------------
"Tosch" <to**********@swissonline.ch> wrote in message
news:m8********************************@4ax.com...
Ken,

I know that, but how do I pass this to the first instance of the
app???

Thomas
On Sun, 5 Oct 2003 11:44:30 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

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

Ken
------------------------
"Tosch" <to**********@swissonline.ch> wrote in message
news:o8********************************@4ax.com.. .
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

Nov 20 '05 #4

P: n/a
That's an idea, I'll try this.

Thomas

On Sun, 5 Oct 2003 12:57:51 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
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
------------------
"Tosch" <to**********@swissonline.ch> wrote in message
news:m8********************************@4ax.com.. .
Ken,

I know that, but how do I pass this to the first instance of the
app???

Thomas
On Sun, 5 Oct 2003 11:44:30 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
>Hi,
>
> Environment.GetCommandLineArgs() returns a string array of the
>command line arguments.
>
>Ken
>------------------------
>"Tosch" <to**********@swissonline.ch> wrote in message
>news:o8********************************@4ax.com.. .
>> 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
>


Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.