If app.exe is running then form1, else form2

Benjagan91
08-20-2009, 08:06 PM
Hi,

I have application.frm with a command button on it. When i press the command button i'd like form1.frm to be displayed and app.exe to run. Then when app.exe is finished what it's doing and closes, i want form1.frm to unload and form2.frm to load.

I guess i need something to check if app.exe is running in memory or something? I'd appreciate whatever help you guys can provide for me :) I'm new to VB but i'm getting better :D

Thanks.

Regards, Benjagan91

vb5prgrmr
08-20-2009, 08:35 PM
Search for Shell and Wait or Wait on application to finish.



Good Luck

Benjagan91
08-20-2009, 09:41 PM
Doing a search on that returned results on how to wait for shell commands and such. Can you please help me write the code to do what i need? :)

vb5prgrmr
08-21-2009, 08:50 PM
Yahoo/Google are your friends. This code is out there and nearly everywhere...

In this search there are code snipits to whole progs/functions just in the first five matches...

http://search.yahoo.com/search?p=vb6+shell+and+wait+-net&fr=yfp-t-152&toggle=1&cop=mss&ei=UTF-8


Good Luck

Benjagan91
08-23-2009, 09:00 PM
I have found codes like the following, but i have trouble understanding how they work, and how to modify them and implement them to suit what i'm trying to do.

http://www.visualbasic.happycodings.com/Other/code38.html

Can somebody please explain the code to me?

Thanks.

Regards, Benjagan91

vb5prgrmr
08-23-2009, 11:25 PM
This example may be easier for you to understand...

http://www.thescarms.com/vbasic/wait.aspx

However, it waits for an infinite amount of time which will make your program become unresponsive so instead use a value like 10 within a doevents loop testing the results of the API call kind of like in the example you posted.



Good Luck

Benjagan91
08-25-2009, 05:46 PM
That was far easier to understand, i think i'm good now :D I'll have a play with this code.

Thanks!

Regards, Benjagan91

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum