AllowSetForegroundWindow (user32)
Last changed: picrofo@gmail.com-41.69.10.250

.
Summary
Enables the specified process to set the foreground window using the SetForegroundWindow function. The calling process must already be able to set the foreground window. For more information, see Remarks later in this topic.

C# Signature:

[DllImport("user32.dll")]
static extern bool AllowSetForegroundWindow(int dwProcessId);

VB.Net Signature:

<DllImport("user32.dll")> _
Shared Function AllowSetForegroundWindow(ByVal dwProcessId As Integer) As Boolean
End Function

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

ASFW_ANY = -1 // by MSDN

Sample Code:

AllowSetForegroundWindow(System.Diagnostics.Process.GetCurrentProcess().Id)

Alternative Managed API:

Do you know one? Please contribute it!

Documentation