473,320 Members | 1,814 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,320 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 1605
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.