Dim ch As Boolean
ch = False
Dim ps As System.Diagnostics.Process() = System.Diagnostics.Process.GetProcesses()
For Each p As System.Diagnostics.Process In ps
If ("dlgpy" = p.ProcessName) Then
ch = True
我想在这里让这个程序获得焦点,如何实现?
在p.这里查了好久没发现获得焦点的命令。
Exit For
End If
Next
If ch = False Then
Dim Proc As New Process '定义一个新的Process
proc.StartInfo.FileName = "C:\Program Files\dlgpy\dlgpy.exe"
proc.StartInfo.UseShellExecute = False
Proc.StartInfo.WorkingDirectory = "C:\Program Files\dlgpy"
Proc.Start()
End If