|
-
August 27th, 2001, 10:02 AM
#1
Open External Executable
I'm trying to set up a simple VB progam that will give the user 3 options. 1&2) Open on of to Executable files 3)Exit
I'm not sure if I should use an Open Statement, Run Command etc.
Also, I need to determine whether the Application is already active and if it is, inform the user with a Message box.
If anyone could give me a little help with this, It would be greatly appreciated.
Thanks.
-
August 27th, 2001, 10:15 AM
#2
Re: Open External Executable
It may be useful the "shell" command, but it will run the executable asincronously, at it will require some works to keep track. if you're going to call Office applications, it will be better to use com (reference the library inside vb and create an istance of those programs). This is not fiew code, so it may be better to have a look to numerous example:
Make a search here (look on top: forum index|FAQ|Edit Profile|...|Search|) for "WaitforSingleObject" and "Excel" or "Application" and read questions and answers.
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
August 27th, 2001, 10:18 AM
#3
Re: Open External Executable
To run the executeable you can use the Shell command. As for determining if the program is already running, I would be glad if someone told me a way that works with every 32bit windows version.
hth,
daniel
-
August 27th, 2001, 10:19 AM
#4
Re: Open External Executable
I think the commonly accepted method for doing this is using the Shell() function to start the other applications.
If you wrote the other applications being called by the first one, you can use App.PrevInstance property to determine if another copy of the application is already running, if not, you'll have to use some API Calls to try and find out if they're already running... I use the EnumWindows API.
Hope this helps!
DJ
-
August 27th, 2001, 10:22 AM
#5
Re: Open External Executable
I use the EnumWindows API which works OK on 95 and 98... don't know about NT.
DJ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|