Click to See Complete Forum and Search --> : Two Apps


Surrendermonkey
February 16th, 2000, 10:04 AM
(Thanks, Lothar.

Many moons ago I believe it was yourself who supplied me with the answer to a fairly straight forward query about using one exe to launch a second. The solution was based on "Shell". Well...)
I wish to run two exe's concurrently. One organises some system niceties and supplies introductory forms. Based on user input, it launches whichever one of several exes is appropriate. Thus, while being used, the app Group runs two exes concurrently.
I cannot figure out how to close down the "backgroup" app when the Principal one is closed. Can Shell perofrm both a launch and a closure?

Thanks for reading,,
Surrendermonkey

Kyle Burns
February 16th, 2000, 10:11 AM
If you create your second app as an ActiveX exe, then you could control it through Automation and be notified through events about the status of your second app. Since you're writing both apps, this might be a solution worth investigating.

Lothar Haensler
February 16th, 2000, 10:12 AM
>Can Shell perofrm both a launch and a closure?

I don't think so.
You could try to post a WM_CLOSE message to your second app.
You need to get the window handle of the main form window, though.
If you know the caption of that form window you could use the FindWindow API to get the window handle of your second app.

if you need full control over both apps and have the source code for both apps, I suggest you turn your apps in ActiveX Exes and use COM (automation) to control your apps.