I am starting a PDF, and I get a process. The PDF is shown in a Chrome window.
Then I try to find this process among the processes, but it is not there. I have even tried adding some time to wait before calling GetProcesses(), but that wouldn't change anything.
What am I missing?
Private Sub btnTest_Click(sender As Object, e As EventArgs) Handles btnTest.Click
Dim sPath As String = "d:\test.pdf"
Dim nProc As Process = System.Diagnostics.Process.Start(sPath)
Dim iProcID As Integer = nProc.Id
Dim allProcesses() As Process = System.Diagnostics.Process.GetProcesses
For Each nProcess As Process In allProcesses
If nProcess.Id = iProcID Then
Stop 'found :-)
End If
Next
End Sub