Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 1999-01-05
2
Medium Priority
?
194 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

722 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