Notice Of Closure

Please note that this website is due to close down on 15th June 2020.

In the interim I will try to move as much content as possible over to my GitHub account. Thanks to everyone who has supported the site over the years.

» Help

How to block input to the system until released


The Windows API BlockInput function prevents all input to the system, making it appear locked up until released. Declare the function as:

function BlockInput(fBlockInput: Boolean): DWORD; stdcall;
  external 'user32.dll';

Usage: Set to True to "lock-up" and False to "unlock" input devices.

The following code locks up input for 2 seconds:

procedure TForm1.Button1Click(Sender: TObject);
  Label1.Caption := 'Blocked';
  Label1.Caption := 'Unblocked';

Example code added by Peter Johnson

Author: DennisLV
Added: 2007-06-11
Last updated: 2007-06-11

« Return to contents »