Click here to Skip to main content
15,898,848 members
Home / Discussions / C#
   

C#

 
Generaldocument the items of the form Pin
Strategic_Thinker8-Feb-08 10:34
Strategic_Thinker8-Feb-08 10:34 
AnswerRe: document the items of the form Pin
Ravi Bhavnani8-Feb-08 11:03
professionalRavi Bhavnani8-Feb-08 11:03 
GeneralRe: document the items of the form Pin
Strategic_Thinker8-Feb-08 23:20
Strategic_Thinker8-Feb-08 23:20 
GeneralRe: document the items of the form Pin
Ravi Bhavnani9-Feb-08 3:43
professionalRavi Bhavnani9-Feb-08 3:43 
GeneralRe: document the items of the form Pin
Strategic_Thinker9-Feb-08 7:17
Strategic_Thinker9-Feb-08 7:17 
GeneralRe: document the items of the form Pin
Ravi Bhavnani9-Feb-08 8:26
professionalRavi Bhavnani9-Feb-08 8:26 
GeneralRe: document the items of the form Pin
Strategic_Thinker9-Feb-08 10:07
Strategic_Thinker9-Feb-08 10:07 
QuestionProblem with HasExited and WaitForExit() Pin
danielhasdibs8-Feb-08 7:39
danielhasdibs8-Feb-08 7:39 
I've asked this before, but I didn't get an answer that fixed the problem.

Here is what I want to do:

I have a program that opens two applications (a Word document, and a hyperlink). It opens one after the other. What I'm trying to do is open the first application (the Word document) and AFTER the user closes the application, open the second one (the hyperlink).

I have tried using the boolean HasExited as well as the method WaitForExit(). Neither are working. As soon as the first application opens, the HasExited is false and WaitForExit() does nothing, even when I use the overloaded version.

Here is my code:

System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();<br />
                                    psi.RedirectStandardOutput = true;<br />
                                    psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;<br />
                                    psi.UseShellExecute = false;<br />
                                    psi.Arguments = @txt_Wordfile.Text;<br />
                                    psi.FileName = @WordExe[0];<br />
                                    <br />
                                    System.Diagnostics.Process WordProcess = new System.Diagnostics.Process();<br />
                                    <br />
                                    WordProcess = System.Diagnostics.Process.Start(psi);<br />
                                    WordProcess.EnableRaisingEvents = true;<br />
                                    WordProcess.WaitForExit(10000);<br />
                                    <br />
                                    System.Diagnostics.Process.Start(txt_websiteAddress.Text);


Please Help! Thanks!
GeneralRe: Problem with HasExited and WaitForExit() Pin
PIEBALDconsult8-Feb-08 7:50
mvePIEBALDconsult8-Feb-08 7:50 
GeneralRe: Problem with HasExited and WaitForExit() Pin
danielhasdibs8-Feb-08 7:54
danielhasdibs8-Feb-08 7:54 
GeneralRe: Problem with HasExited and WaitForExit() [modified] Pin
PIEBALDconsult8-Feb-08 8:39
mvePIEBALDconsult8-Feb-08 8:39 
GeneralRe: Problem with HasExited and WaitForExit() Pin
DaveyM698-Feb-08 9:02
professionalDaveyM698-Feb-08 9:02 
GeneralRe: Problem with HasExited and WaitForExit() Pin
danielhasdibs8-Feb-08 10:11
danielhasdibs8-Feb-08 10:11 
GeneralRe: Problem with HasExited and WaitForExit() Pin
danielhasdibs8-Feb-08 8:41
danielhasdibs8-Feb-08 8:41 
GeneralRe: Problem with HasExited and WaitForExit() Pin
Gareth H8-Feb-08 8:59
Gareth H8-Feb-08 8:59 
GeneralRe: Problem with HasExited and WaitForExit() Pin
danielhasdibs8-Feb-08 9:33
danielhasdibs8-Feb-08 9:33 
GeneralRe: Problem with HasExited and WaitForExit() Pin
Ennis Ray Lynch, Jr.8-Feb-08 9:00
Ennis Ray Lynch, Jr.8-Feb-08 9:00 
GeneralRe: Problem with HasExited and WaitForExit() Pin
PIEBALDconsult8-Feb-08 9:20
mvePIEBALDconsult8-Feb-08 9:20 
GeneralRe: Problem with HasExited and WaitForExit() Pin
danielhasdibs8-Feb-08 9:29
danielhasdibs8-Feb-08 9:29 
GeneralRe: Problem with HasExited and WaitForExit() Pin
PIEBALDconsult8-Feb-08 9:40
mvePIEBALDconsult8-Feb-08 9:40 
GeneralRe: Problem with HasExited and WaitForExit() [modified] Pin
danielhasdibs8-Feb-08 9:37
danielhasdibs8-Feb-08 9:37 
GeneralRe: Problem with HasExited and WaitForExit() [modified] Pin
PIEBALDconsult8-Feb-08 9:48
mvePIEBALDconsult8-Feb-08 9:48 
GeneralRe: Problem with HasExited and WaitForExit() Pin
PIEBALDconsult8-Feb-08 10:02
mvePIEBALDconsult8-Feb-08 10:02 
GeneralRe: Problem with HasExited and WaitForExit() Pin
danielhasdibs8-Feb-08 10:09
danielhasdibs8-Feb-08 10:09 
GeneralRe: Problem with HasExited and WaitForExit() Pin
PIEBALDconsult8-Feb-08 10:48
mvePIEBALDconsult8-Feb-08 10:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.