Imports System.Diagnostics Imports System.Runtime.InteropServices <DllImport("user32.dll")> Public Shared Sub SwitchToThisWindow(ByVal hWnd As IntPtr, ByVal fAltTab As Boolean) End Sub Private Sub button3_Click(ByVal sender As Object, ByVal e As EventArgs) Dim pName As String = "dvdplay" Dim temp As Process() = Process.GetProcessesByName(pName) If temp.Length > 0 Then Dim handle As IntPtr = temp(0).MainWindowHandle SwitchToThisWindow(handle, True) Else Process.Start(pName & ".exe") End If End Sub
引用:http://blog.csdn.net/baidu_27474941/article/details/53161697