1
2
3
4
5
6
7
8
9
10
11
12
13
|
//Einbinden von:
using System.Runtime.InteropServices;
//Als externe Methode deklarieren...
[DllImport("User32.dll")]
static extern long SetForegroundWindow(int hwnd);
//Und einfach aus einer Form heraus aufrufen...
private void abInDenVordergrund()
{
int hwnd = this.Handle.ToInt32();
SetForegroundWindow(hwnd);
}
|