展开全部
转来的程序,你试着用下吧。。function FunctionDetect (LibName, FuncName: String; var LibPointer: Pointer): boolean;
var LibHandle: tHandle;
begin Result := false;
LibPointer := NIL;
if LoadLibrary(PChar(LibName)) = 0 then exit;
LibHandle := GetModuleHandle(PChar(LibName));
if LibHandle <> 0 then
begin
LibPointer := GetProcAddress(LibHandle, PChar(FuncName));
if LibPointer <> NIL then Result := true;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var xBlockInput :
function (Block: BOOL): BOOL; stdcall;
begin
if FunctionDetect (’USER32.DLL’, ‘BlockInput’, @xBlockInput) then
begin xBlockInput (True); // 禁止键盘鼠标
Sleep(10000); // 等待10秒
xBlockInput (False); // 允许键盘鼠标
end;
end
var LibHandle: tHandle;
begin Result := false;
LibPointer := NIL;
if LoadLibrary(PChar(LibName)) = 0 then exit;
LibHandle := GetModuleHandle(PChar(LibName));
if LibHandle <> 0 then
begin
LibPointer := GetProcAddress(LibHandle, PChar(FuncName));
if LibPointer <> NIL then Result := true;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var xBlockInput :
function (Block: BOOL): BOOL; stdcall;
begin
if FunctionDetect (’USER32.DLL’, ‘BlockInput’, @xBlockInput) then
begin xBlockInput (True); // 禁止键盘鼠标
Sleep(10000); // 等待10秒
xBlockInput (False); // 允许键盘鼠标
end;
end
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询