1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
[DllImport("user32")]
public static extern bool BlockInput(bool BlockIt);
/// <summary>
/// Blockiert die Eingaben des Benutzers für eine bestimmte Zeit.
/// </summary>
/// <param name="time">Die Zeit der Blockierung in Millisekunden.</param>
public void BlockUserInput(int time)
{
BlockInput(true);
System.Threading.Thread.Sleep(time);
BlockInput(false);
}
// Beispielaufruf für die Blockierung von 10 Sekunden:
BlockUserInput(10000);
|