PDA

Click to See Complete Forum and Search --> : Waiting while instance of IE is open


stipsa
Aug 29th, 2000, 04:23 PM
I use following code to open .HTML file with IE. I have to wait in loop while ie window or peocess behind it finishes.
The usuall microsoft example for waiting for shell program to finish, here doesn't work. I need to get some information, at least if Ie window is open, but Iswindow API doesn't work.

Public Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal _
lpDirectory As String, ByVal nShowCmd As Long) As Long

sub main

res = ShellExecute(0&, vbNullString, "c:\windows\desktop\proba.htm", vbNullString, vbNullString, vbNormalNoFocus)
If res <= 32 Then
MsgBox ("Unable to send information to internet!" & Chr(10) & "Next try will be when you login."), vbOKOnly
Exit Sub
End If

end sub

Please help, Thanks

gfrench
Aug 29th, 2000, 06:13 PM
If it is any help, the shell command built into vb returns the task id, i dont know if this will be much good to you thoug, i suppose you could enumerate the tasks that are running on the system and check to see if the task you ran is there, but i am afraid i do not know how to enumerate the tasks on a system.

Sorry, just a stepping stone in a long path.

Aug 29th, 2000, 09:59 PM
Use a DoEvents which will wait until the program is loaded and complete the rest of the code.