Start and wait for an IE process with appointed name

Y

yxq

Hello,
I start an Internet Explorer process with appointed window title(i.e. TEST),
and wait for the user to abort it.
the code below engross 100% CPU resource, how ameliorate the code? Thank
you.

**********************************************************

Dim objPro As New Process
objPro.StartInfo.FileName = "explorer.exe"
objPro.StartInfo.Arguments = "http://TEST.com/"
objPro.Start()

System.Threading.Thread.CurrentThread.Sleep(10000)
re:
For Each a As Process In Process.GetProcesses
If InStr(a.MainWindowTitle.ToLower, "test") > 0 Then
GoTo re
End If
Next
 
Y

yxq

I use Shell

Dim IEPath As String =
System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles).ToString
& "\Internet Explorer\iexplore.exe"
Shell(IEPath & " http://TEST.com/", AppWinStyle.MaximizedFocus, True)

It work fine.

Thank you
 
C

Cor Ligthert [MVP]

yxq,

I don't believe that you can get the end from this. I never used it, however
you can start IE as well using all the things from Webbrowswer. (Not all
methods do than work).

You need than another constructor for this than with the AxWebbrowser

Set a reference to SHDocVw.Dll
Dim myIE As New SHDocVw.InternetExplorer
And than you have all I know from this.

However maybe previous messages about this can than help you.

http://groups.google.com/group/micr...etExplorer&qt_g=1&searchnow=Search+this+group

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top