こんにちは。
起動した別プロセスの終了イベントを拾いたいのですがうまくいきません。
プロセスを起動した後、すぐにProcess.Exitedイベントが発生してしまいます。
原因が思い当たらず、質問させて頂きました。
よろしくお願いします。
過去のスレッドを参照して、以下のようなソースを組んでみました。
Dim proc As System.Diagnostics.Process
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
proc = New System.Diagnostics.Process()
proc.StartInfo.FileName = "\Windows\pimg.exe"
End Sub
Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
proc.EnableRaisingEvents = True
AddHandler proc.Exited, AddressOf Process_Exited
proc.Start()
Label1.Text = "動作中"
End Sub
Private Sub Process_Exited(ByVal sender As System.Object, ByVal e As System.EventArgs)
MessageBox.Show("終了")
End Sub
動作環境 T-01A(WindowsMobile6.1 Professional)、VB2005