anchor.diff:    begin
   
       OneWinInstance := TUniqueWinInstance.Create(nil);
  -    OneWinInstance.SetServerId('cudatext.1');
  -    OneWinInstance.SetUniqueInstanceId(GetServerId('cudatext.0'));
  -    OneWinInstance.SetTargetId('cudatext.2');
  +    OneWinInstance.Id := 'cudatext.1';
  +    OneWinInstance.UniqueInstanceId := GetServerId('cudatext.0');
  +    OneWinInstance.TargetId := 'cudatext.2';
       Result := OneWinInstance.IsAnotherInstance;
   
       OneWinInstance.Free;
     end;
   
   end;
  +
  +var
  +  hLib: HINST;
  +
  +initialization
  +  hLib := LoadLibrary('user32.dll');
  +  Pointer(SwitchFunc) := GetProcAddress(hLib, 'SwitchToThisWindow');
  +
  +finalization
  +  if hLib <> 0 then
  +     FreeLibrary(hLib);
   
   {$else}
   procedure DoFocusWindow(h: THandle);
  
positive.code:       Client.Active := True;
        Client.SendStringMessage(ParamCount, GetFormattedParams);
      end;
      hLib:= LoadLibrary('user32.dll');
      try
        Pointer(SwitchFunc):= GetProcAddress(hLib, 'SwitchToThisWindow');
      finally
        FreeLibrary(hLib);
      end;
      Sleep(10);
      if Assigned(SwitchFunc) then
      begin
         SwitchFunc(StrToInt(CudaWnd), True);
      end;
      Client.Free;
    end;
  end;
  
  procedure TUniqueWinInstance.SetServerId(Id: String);
  begin
    _ServerId:=Id;
  end;
  
  procedure TUniqueWinInstance.SetTargetId(Id: String);
  begin
    _TalkWith:=Id;
  end;
  
  procedure TUniqueWinInstance.SetWndHandle(Wnd: HWND);
  begin
    _WindowHandle:=Wnd;
  end;
  
  procedure TUniqueWinInstance.SetUniqueInstanceId(Id: String);
  begin
    _UniqueInstanceId:=Id;
  end;
  
  constructor TUniqueWinInstance.Create(AOwner: TComponent);
  
negative.code:     _ServerId: String;
      _UniqueInstanceId: String;
      procedure ReceivedMessage(Sender: TObject);
    public
      property WindowHandle: HWND write _WindowHandle;
      property TargetId: String write _TalkWith;
      property Id: String write _ServerId;
      property UniqueInstanceId: String write _UniqueInstanceId;
      constructor Create(AOwner: TComponent); override;
      destructor Destroy; override;
      function IsAnotherInstance: boolean;
  