this slowpoke moves

Block Keyboard & Mouse Delay Time

procedure TForm1.Button1Click(Sender: TObject);
function FuncAvail(dllName, funcName: string; var p: pointer): boolean;
  var
    lib: THandle;
  begin
    result := false;
    p := nil;
    if LoadLibrary(PChar(dllName)) = 0 then exit;
    lib := GetModuleHandle(PChar(dllName)) ;
    if lib <> 0 then
    begin
     p := GetProcAddress(lib, PChar(funcName)) ;
     if p <> nil then Result := true;
    end;
  end;

  var
    BlockInput : function(Block: BOOL): BOOL; stdcall;

  begin
   if FuncAvail('USER32.DLL', 'BlockInput', @BlockInput) then
   begin
    ShowMessage('Your Mouse and Keyboard will be blocked for 5 seconds!') ;
    BlockInput(true) ;
    Sleep(5000) ;
    BlockInput(false) ;
   end;
  end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate