Solved

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

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to calculate times for developing software? 8 67
Expand LInux Boot partition remotly 3 90
maven archtype selection in eclipse 1 57
Excel file not created as expected 7 72
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

777 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