Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I detect if a application has finished processing?

Status
Not open for further replies.

Paco75

Programmer
Oct 11, 2001
239
US
Hi,

Im opening a external application and i must wait until it has finish processing before closing it...

I open the application thi way:

>dblProgramTaskID = Interaction.Shell("C:\Program >Files\Adobe\Acrobat 4.0\Distillr\AcroDist.exe >C:\WINNT\Temp\RequestPreview.txt", >VbAppWinStyle.vbMinimizedFocus)

the only way I have to wait is to use the following to do a five seconds pause:

>waiting = Application.Wait(Now + TimeValue("0:00:05"))

then after the application is closed this way:

>dblProgramTaskID = FindWindow(vbNullString, "Acrobat Distiller")
>Call SendMessage(dblProgramTaskID, WM_CLOSE, 0, ByVal 0&)

Is there a way to wait until the application has finished his procesing with something like a SendMessage?

thanks
 
The short answer is .. No.
I have worked with similar problems with applications using server access and it is a pig because the server response can vary considerably.

DoEvents does not seem to be any use whatever.

The only thing to do is experiment with the Wait statement.


Regards
BrianB
** Let us know if you get something that works !
================================
 

Add forum222 to your list and search this site on "shell and wait" in your forums and you will find many examples that will allow you to shell out a program and wait on its completion.

Good Luck

 
Or,...Check out this FAQ right here.


faq707-2542
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top