Howdy all,
Here's an example of what I'm trying to do. If my process has not started, then start it. If my process has started, then bring the currently running process to the front instead of opening another instance of it. For example
vb.net Code:
  1. Private p As Process = Nothing
  2.  
  3. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  4.     If p Is Nothing OrElse p.HasExited Then
  5.         p = New Process()
  6.         p.StartInfo.FileName = "c:\test.txt"
  7.         p.Start()
  8.     Else
  9.         ' This process is already running so
  10.         ' bring is to the front/maximize it
  11.         ' instead of opening another one.
  12.     End If
  13. End Sub

I've waded through the Process class but have not found what I'm looking for. How can I, if in the example above, I already have an instance of NotePad open, bring it to the front instead of opening another instance?

Am I smelling API of some sort? Sorry if this turns out to be the inappropriate forum. Thanks.