calling one .exe while running another .exe

yonasjk
08-22-2001, 07:46 AM
I need some assistance as to a particular stumbling block....

Background info: I have two programs (program1 & program2) which are both executables. They have been developed using three forms each.

The problem: While I am operating program1.exe, I need to be able to call up a particular form in program2.exe. Currently I am able to call program2 using...
Shell(App.Path & "\program2.exe",vbNormalFocus)
...but I am not able to open it to form2 in program2! It will open to the main page but I need a different form to appear! That is my dilemna?

General questions: Is it possible to call a particular form in a different program other than the current program you are in?
If not, can I use a script or macro to automate the keystrokes of program2.exe? Could use any advice or code samples....

Thanks

Derek Stone
08-22-2001, 08:35 AM
What you need to do is pass some parameters through the Shell() function to the application you're opening.
Example:

<pre>Shell "myapp.exe showwindow2"

</pre>

Then, in your second appplication:

<pre>Sub Main()
Dim strTemp As String
strTemp = Command$
Select Case strTemp
Case "showwindow1"
Form1.Show
Case "showwindow2"
Form2.Show
Case "showwindow3"
Form3.Show
End Select
End Sub

</pre>

Good Luck
-cl

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum