
Launch an app modally from VB6
Hi
I'd like to be able to launch an application from within a VB6 application,
and have the second app behave like a modal dialog. Ie. App2 and it's child
dialogs should always remain on top of App1 and it's dialogs. However, if
App2 is moved around, App1 should still repaint itself as necessary.
Is there any recommended way of doing this?
So far, I've tried launching App2 from within App1 using the Shell command,
then waiting in a message loop processing only paint commands for App1 until
App2 exits (by checking the return code from GetExitCodeProcess). This
ensures that the user cannot do anything with App1 while App2 is running,
but ensures that App1 gets painted correctly. The problem with this approach
is that App2 can still fall behind App1 which I want to prevent.
I have also tried using the Windows Scripting host 'Run' command, but this
has the same issue. The code is blocked at the point of App2's launch in
App1, but App1's window can still be brought to the front!
Thanks for any advice,
Shaun.