?
Solved

Already Running Applications and Command-Line Arguments

Posted on 2003-03-11
6
Medium Priority
?
404 Views
Last Modified: 2013-11-13
I have an application I want to load files by double clicking, the following questions came from my attempts:

1. How do you pass command-line arguments to an application if it is already running, and the AppActivate procedure does not manage to activate the application except when running from VB?
2. How do you clear a command-line argument?

Thank you, Phil
0
Comment
Question by:PhilAI
[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
  • 3
  • 2
6 Comments
 
LVL 6

Author Comment

by:PhilAI
ID: 8112978
I have an application I want to load files by double clicking, the following questions came from my attempts:

1. How do you pass command-line arguments to an application if it is already running, and the AppActivate procedure does not manage to activate the application except when running from VB?
2. How do you clear a command-line argument?

Thank you, Phil
0
 
LVL 1

Expert Comment

by:timd_jones
ID: 8115976
You can't pass a command-line argument to an application that is already running.

If you are trying to control an application that is not your own, you may be able to control it if you can reference the other application's object library in your Visual Basic application. If the application you are launching is your own VB app, then you can establish communication between the apps using COM methods, or windows sockets, or a common location in the registry to pass values, etc.

AppActivate is purely a VB, VBA or VBSCript command, but you should be able to "activeate" any application where you know the exact window title.

A command-line argument inside of your own VB app is simply a variant array, and you can just set it to Empty, or ignore it.
0
 
LVL 2

Expert Comment

by:spauljoseph
ID: 8117120
From your question I understand that you're trying to pass some data to an existing (already running?) application from the launched application. You can refer a program from here http://zephyrit.netfirms.com/PassString.Zip (right-click on choose Save Target As...) for knowing about passing strings from an application to already running application.

To use that program. Extract the zip file and open the ReceiveData.vbp first and start it and then open SendData.vbp and start that. check how it is tranmitting strings and numerics. Hope that helps.

NOTE: command-line arugments wont help you in this context as timd_jones said.
0
Industry Leaders: 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!

 
LVL 6

Author Comment

by:PhilAI
ID: 8117849
timd_jones: Thank you for confirming that; it is in fact my own appication and I have used Winsock control before.

How would I set it the command-line to empty, exactly?

Thanks
0
 
LVL 1

Accepted Solution

by:
timd_jones earned 225 total points
ID: 8118575
Try

ReDim Command(0)

to clear the array
0
 
LVL 6

Author Comment

by:PhilAI
ID: 8119038
That works, bit dodgy, but it works - it is not like I want to use the Command-line again after.

Thank you
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.
Suggested Courses

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