Author: Walter Alves Chagas Junior How to disable mouse and keyboard for n seconds Answer: This Function detect is Function exists in Library (dll) 1 2 function FuncAvail(VLibraryname, VFunctionname: string; var VPointer: pointer): 3 boolean; 4 var 5 Vlib: tHandle; 6 begin 7 Result := false; 8 VPointer := nil; 9 if LoadLibrary(PChar(VLibraryname)) = 0 then 10 exit; 11 VPointer := GetModuleHandle(PChar(VLibraryname)); 12 if Vlib <> 0 then 13 begin 14 VPointer := GetProcAddress(Vlib, PChar(VFunctionname)); 15 if VPointer <> nil then 16 Result := true; 17 end; 18 end; 19 20 //Source code in Button1 on Form1 21 22 procedure TForm1.Button1Click(Sender: TObject); 23 var 24 xBlockInput: function(Block: BOOL): BOOL; stdcall; 25 begin 26 if FuncAvail('USER32.DLL', 'BlockInput', @xBlockInput) then 27 begin 28 xBlockInput(true); 29 Sleep(15000); // 15 secounds 30 xBlockInput(false); 31 end; 32 end;