[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr SetFocus(IntPtr hWnd);
None.
Private Declare Function SetFocus Lib "user32.dll" (ByVal hwnd As IntPtr) As IntPtr
None.
Please add some!
Please add some!
'Focussing on a process's main window when PID is known:
Dim p As Process = Process.GetProcessById("ID Here")
SetFocus(p.MainWindowHandle)
Focus();