BlockInput

[This is preliminary documentation and subject to change.]

Blocks keyboard and mouse events from reaching the raw input thread, and therefore from all applications.

BOOL BlockInput(
  BOOL fBlock
);
 

Parmeters

fBlock
Flag value specifying the call's purpose. If this value is TRUE, hardware input events are blocked until the function is called again by the same thread with a FALSE parameter.

Return Values

Returns TRUE if successful or FALSE if input is already blocked.

Remarks

This function will not interfere with the asynchronous keyboard input state table. This means that calls to the SendInput function while input is blocked will change the asynchronous keyboard input state table.

There are three situations where blocked input will become unblocked:

  1. The thread that blocked input unexpectedly exits without calling BlockInput with fBlock set to FALSE. In this case USER cleans up properly and re-enables input.
  2. The system displays the Close Program/Fault dialog box. This can occur if the thread faults or if the user presses ctrl+alt+delete.
  3. The system invokes the Hard System Error modal message box.

In all cases, USER must unblock software-blocked input. Since system-critical dialog boxes are system modal, in the latter case, the thread owning the block will not resume execution until the user closes the dialog box.