执行下面代码后,系统停止反映。鼠标不能动了 程序一直占内存
procedure TSniffer.monitorendClick(Sender: TObject);
type
  tipMonitorEnd = procedure(); stdcall;
var
  fipmonitorend: tipmonitorend;
    hDll: Thandle;
begin
  hDll := LoadLibrary('SocketInit.dll');
  if hDll = 0 then
    Exit;
    if monitorstart.enabled then exit;
  fipMonitorend := TipMonitorend(GetProcAddress(hDll, 'MonitorEnd'));
  if @fipMonitorend = nil then
  begin
    showmessage('error');
    Exit;
  end
  else
  begin
    fipMonitorend();
    monitorstart.Enabled:=true;
  end;end;

解决方案 »

  1.   

    执行下面代码后,系统停止反映。鼠标不能动了 程序一直占内存
    procedure TSniffer.monitorendClick(Sender: TObject);
    type
      tipMonitorEnd = procedure(); stdcall;
    var
      fipmonitorend: tipmonitorend;
        hDll: Thandle;
    begin
      hDll := LoadLibrary('SocketInit.dll');
      if hDll = 0 then
        Exit;
        if monitorstart.enabled then exit;
      fipMonitorend := TipMonitorend(GetProcAddress(hDll, 'MonitorEnd'));
      if @fipMonitorend = nil then
      begin
        showmessage('error');
        Exit;
      end
      else
      begin
        fipMonitorend();
        monitorstart.Enabled:=true;
      end;end; 
      

  2.   

    执行下面代码后,系统停止反映。鼠标不能动了 程序一直占内存
    procedure TSniffer.monitorendClick(Sender: TObject);
    type
      tipMonitorEnd = procedure(); stdcall;
    var
      fipmonitorend: tipmonitorend;
        hDll: Thandle;
    begin
      hDll := LoadLibrary('SocketInit.dll');
      if hDll = 0 then
        Exit;
        if monitorstart.enabled then exit;
      fipMonitorend := TipMonitorend(GetProcAddress(hDll, 'MonitorEnd'));
      if @fipMonitorend = nil then
      begin
        showmessage('error');
        Exit;
      end
      else
      begin
        fipMonitorend();
        monitorstart.Enabled:=true;
      end;end; 
      

  3.   

    执行下面代码后,系统停止反映。鼠标不能动了 程序一直占内存
    procedure TSniffer.monitorendClick(Sender: TObject);
    type
      tipMonitorEnd = procedure(); stdcall;
    var
      fipmonitorend: tipmonitorend;
        hDll: Thandle;
    begin
      hDll := LoadLibrary('SocketInit.dll');
      if hDll = 0 then
        Exit;
        if monitorstart.enabled then exit;
      fipMonitorend := TipMonitorend(GetProcAddress(hDll, 'MonitorEnd'));
      if @fipMonitorend = nil then
      begin
        showmessage('error');
        Exit;
      end
      else
      begin
        fipMonitorend();
        monitorstart.Enabled:=true;
      end;end;