setfocus (user32)
Last changed: -220.227.240.69

.
Summary

C# Signature:

[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr SetFocus(IntPtr hWnd);

User-Defined Types:

None.

VB.NET Signature:

Private Declare Function SetFocus Lib "user32.dll" (ByVal hwnd As IntPtr) As IntPtr

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

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)

Alternative Managed API:

Focus();

Documentation
SetFocus on MSDN