473,494 Members | 2,223 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1612
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
325
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
4071
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
19549
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
5091
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
20315
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
1202
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
3505
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
50901
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
1898
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
25211
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
6989
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7367
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1400
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.