As I mentioned in my above comment, Chrome starts many instances of itself. Each tab has its own process, so how are you going to tell it which one to switch to?. This come's down to what tab was selected when you minimize the window or it minimizes itself to the task bar. Below should help you out and it's tried and tested. The only issue is, if you open Chrome and have multiple tabs it's fine, but if you create another instance of Chrome it will not show the second instance, it will only bring forward the first instance... If you close the first instance, the second instance of course will come forward.
Public Class Form1 #Region "DLL Imports" <System.Runtime.InteropServices.DllImport("User32.dll")> _ Private Shared Function SetForegroundWindow(handle As IntPtr) As Boolean End Function <System.Runtime.InteropServices.DllImport("User32.dll")> _ Private Shared Function ShowWindow(handle As IntPtr, nCmdShow As Integer) As Boolean End Function <System.Runtime.InteropServices.DllImport("User32.dll")> _ Private Shared Function IsIconic(handle As IntPtr) As Boolean End Function #End Region Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click StartOrShowProcess("chrome") End Sub Private Sub StartOrShowProcess(ByVal strProcessName As String) Try Dim handle As IntPtr Dim proc As Process() = Process.GetProcessesByName(strProcessName) If proc.Count > 0 Then For Each procP As Process In proc handle = procP.MainWindowHandle If handle <> 0 AndAlso IsIconic(handle) Then 'Do we have a handle and is it minimized? ShowWindow(handle, 9) SetForegroundWindow(handle) End If Next Else 'Not running or started... Process.Start(strProcessName) End If Catch ex As Exception 'Handle your error... End Try End Sub End Class
Chromestart's many instances of itself. Each tab has it's own process, so how are you going to tell it which one to switch to?