Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Passing cmd line args from one app to another that's already running?

Posted on 1999-01-05
2
Medium Priority
?
195 Views
Last Modified: 2013-11-20
I have an application that allows only one instance of itself to run. I'd like to pass in the command line args from a second instance that's trying to start up, then dismiss the second instance before it comes up. Is there any easy way to do this?
0
Comment
Question by:barrett
2 Comments
 
LVL 1

Accepted Solution

by:
dd_b earned 300 total points
ID: 1327261
hi

there is no direct way to send cmd parameter, b'cas u r not controling the application. The easiest way to pass parameter is  using file, whenever u start your appliction write some signeture in the file ( temp file ). & delete on exit. Using this file on start of your application always check the signeture. if signeture exits return false. This is what i did in my project.

0
 

Author Comment

by:barrett
ID: 1327262
OK, this is interesting. Is the idea that you write the command line params to the temp file? Then send the first instance of the app, say, WM_ACTIVATEAPP - when the first instance receives the message, it could then check the temp file for params and handle accordingly. Seems this could be done with the registry as well.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question