Solved

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

Posted on 1999-01-05
2
186 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 100 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now