starting extrenal applications

TMI

Member
Joined
Oct 15, 2003
Messages
16
I am trying to start an external application by sending th e required arguments as part of the command line call. Everything works fine but the external app opens up behind what ever application is at the top. I am also using the sendkey for {F6} so the the application will do a function. But the application will not open over the other apps. If I use an input box for the arguments before opening the external application then it runs fine. Here is the code that I have. Can anyone help.

Public Sub runArdis()
Time to open Ardis and generate patterns
Dim myProcess As New Process()
Dim startInfo As New System.Diagnostics.ProcessStartInfo("COWIN.exe")

startInfo.FileName = "j:\projects\" & curProject & "\PATTERN\" _
& ProductType & Phase & "\" & patProd & Phase & ".R41"


startInfo.WindowStyle = ProcessWindowStyle.Normal


Try
myProcess = System.Diagnostics.Process.Start(startInfo)
Catch ex As Exception
MsgBox("runArdis Error! " & ex.Message)
End Try


End Sub
 
You could use the BringWindowToTop of function of the Win32Api, or possibly a combination of Win32Api functions to get the results your looking for. Look up API-Guide 3.7 on Google to get a pretty basic program explaining the Win32Api functions... it for VB6, but if you know VB6 you can upgrade it to your current language, whatever that is. Good Luck!
 
Back
Top