473,549 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
+ 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

ProcessStartInf o startupInfo = new ProcessStartInf o ();
startupInfo.Fil eName = filePath;
startupInfo.Use ShellExecute = true;
startupInfo.Cre ateNoWindow = true;
Process process = Process.Start (startupInfo);
process.WaitFor Exit();

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>bDHb7PEolke YII48FfKj9Q==</Id>
Nov 22 '05 #1
2 1626
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 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...
12
4081
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 program in C# (my first!!) and it works with one major problem. This program detects when the desktop program is not running and starts it again....
2
19569
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 app is NOT waiting for the execution of backup_files.cmd to finish. How can I cause my console app to wait for backup_files.cmd to finish before
4
5106
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 = Process.Start(psInfo); I have two questions need your help:
11
20327
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 wait for all its threads to finish? For example, if I start 20 threads: CustomThreadPool pool = new CustomThreadPool("PetersThreadPool");...
0
1206
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 my application) they will not be opened till the shelled program finishes. I tested both following methods:
5
3516
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 output file to the userdata directory, if it's successful. The problem I'm having is that on myProcess.WaitForExit() I get a...
18
50921
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 do? Thanks yal!
1
1907
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 clue? Rgds, Divyesh
5
25214
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 batch file start.bat. The piece of code which I am using is: public static void ExecuteScripts(){ try { \\Start the first batch program...
0
7546
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7471
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7985
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7830
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5387
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5111
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1962
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 we have to send another system
1
1082
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
784
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.