473,387 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How do you wait for an IE process to finish when started with Process.Start()

I am developing a WinForm application which will redirect theuser to HTML page, using IE, when they click a button. However,I want this to be modal in operation, so I would like to makesure that the IE process has finished before I allow then tocontinue.

I first tried using the WaitForExit method of the Process class,but this returns an error while IE is still showing the HTMLpage. Is there any way that I can ensure the page is closedbefore allowing the user to continue?

If possible, I would like to stay away from using an embeddedbrowser control as this looks a little bit too complex for whatI am trying to achieve.

A code sample is below

ProcessStartInfo startupInfo = new ProcessStartInfo ();
startupInfo.FileName = filePath;
startupInfo.UseShellExecute = true;
startupInfo.CreateNoWindow = true;
Process process = Process.Start (startupInfo);
process.WaitForExit();

The filePath variable is the fully qualified path to a HTMLdocument. By the time the WaitForExit is called, an Objectreference not set exception is thrown.

Thanks in advance

--------------------------------
From: Stephen Haeney

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>bDHb7PEolkeYII48FfKj9Q==</Id>
Nov 22 '05 #1
2 1609
Hi Stephen,

I think that this will be a hard way to go, the user can open another window
in IE or a page can do that for him.

Why not building your own webbrowser with limited browser capabilities.

It is almost here already completly for you.

webbrowser
http://support.microsoft.com/?kbid=311303

I hope this helps?

Cor
Nov 22 '05 #2
Hi Stephen,

I think that this will be a hard way to go, the user can open another window
in IE or a page can do that for him.

Why not building your own webbrowser with limited browser capabilities.

It is almost here already completly for you.

webbrowser
http://support.microsoft.com/?kbid=311303

I hope this helps?

Cor
Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Stephen Haeney via .NET 247 | last post by:
I am developing a WinForm application which will redirect theuser to HTML page, using IE, when they click a button. However,I want this to be modal in operation, so I would like to makesure that the...
12
by: GTi | last post by:
I have small program that always must be running when a user is logged on. Since users can close this program I must create a program that always check if this program is running. So I created a...
2
by: Jordan S | last post by:
I have written a small Console application that executes the following line, amongst other things: System.Diagnostics.Process.Start(currentWorkingDirectory + @"\backup_files.cmd"); My Console...
4
by: John Lee | last post by:
Hi, I developed a scheduler as service and kick off another console application "DTSRUN.exe" to run a dts package ProcessStartInfo psInfo = new ProcessStartInfo(command); Process process =...
11
by: Peter Kirk | last post by:
Hi there I am looking at using a thread-pool, for example one written by Jon Skeet (http://www.yoda.arachsys.com/csharp/miscutil/). Can anyone tell me if this pool provides the possibility to...
0
by: | last post by:
In my application I wait for a shelled application to finish and continue to work. Everything works fine but when the shelled program is up and user tries to open other applications (outside of...
5
by: Kevin Hodgson | last post by:
I'm trying to launch a command line utility from my VB.NET App, In my function I create a process and launch the executable, and need to wait for it to exit, so that the calling code can move the...
18
by: Coder | last post by:
Howdy everybody! How do I do the following... while (myVary != true){}; Obviously I do not want to use 100% of the processor to stay in this infinite loop till myVar == true. But wait do I...
1
by: Divyesh | last post by:
Hello, I need to call external application from my C# application. I can use Process.Start(<FileName>) for that but I also need to wait for that application to finish before I process. Any...
5
by: chenthil | last post by:
In my Java program I need to call two DOS batch programs namely call.bat and start.bat. First I need to start the batch program call.bat and once that program is completed, I need to call the other...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.