473,395 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Passing parameters to running instance of app

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
4 1835
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: zlatko | last post by:
There is a form in an Access Project (.adp, Access front end with SQL Server) for entering data into a table for temporary storing. Then, by clicking a botton, several action stored procedures...
1
by: wesley | last post by:
Hello, How do I pass object to the current running process? For example my assembly is called program.exe. Once program.exe is running sometime I want to call it again ie: program.exe /m...
8
by: Dennis Myrén | last post by:
I have these tiny classes, implementing an interface through which their method Render ( CosWriter writer ) ; is called. Given a specific context, there are potentially a lot of such objects,...
4
by: Mike Dinnis | last post by:
Hi, I've been working through a number of turorials to try to learn more about retrieving data from a SQL database. I think i've mastered techniques where i create a sql string in the page and...
3
by: Rune Jacobsen | last post by:
Hi all, I am working on my single instance application that now also has a URL type associated with it, according to the Asynchronous Pluggable Protocols information from MSDN. Now, if my...
5
by: Sridhar | last post by:
Hi, I have created a web application. I have a data access dll to interact with database. I added this dll as a reference to the web application. Now let's say if I am calling a function in data...
2
by: william.w.oneill | last post by:
I have an application that takes a few command line parameters. As recommended by others in this group, I'm using a named mutex to ensure that only one instance of the application is running. My...
4
by: Peter Reinhold | last post by:
Hi All, I am developing a small utility, and have run into a small challenge. The util is used for performing operations on a bunch of files, and it can be triggered from the right-click menu...
13
by: frakie | last post by:
Hi 'body, I'm experiencing difficulties on parameter passing. I wrote a library in last months, and now it crashes few times in a month because of errors in parameter passing: using gdb on the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.