Update of /cvsroot/ocs-comps/OCS2/Samples/VCL/Intercept
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10593/Samples/VCL/Intercept
Added Files:
Intercept.dpr Intercept.res Unit1.dfm Unit1.pas
Log Message:
Initially added to source control
--- NEW FILE: Intercept.dpr ---
program Intercept;
uses
Forms,
Unit1 in 'Unit1.pas' {Form3};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TForm3, Form3);
Application.Run;
end.
--- NEW FILE: Intercept.res ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: Unit1.pas ---
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, OrckaSubClass, OrckaInterceptor;
type
TForm3 = class(TForm)
OrckaIntercept1: TOrckaIntercept;
ListBox1: TListBox;
Button1: TButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Edit1: TEdit;
RadioButton3: TRadioButton;
CheckBox1: TCheckBox;
Button2: TButton;
ComboBox1: TComboBox;
RadioButton4: TRadioButton;
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure RadioButton3Click(Sender: TObject);
procedure OrckaIntercept1Message(Sender: TObject; Msg: Integer;
wParam: Cardinal; lParam: Integer);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure RadioButton4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
uses winMsg;
{$R *.DFM}
procedure TForm3.RadioButton1Click(Sender: TObject);
begin
OrckaIntercept1.ToWatch := Button1;
end;
procedure TForm3.RadioButton2Click(Sender: TObject);
begin
OrckaIntercept1.ToWatch := Self;
end;
procedure TForm3.RadioButton3Click(Sender: TObject);
begin
OrckaIntercept1.ToWatch := Edit1;
end;
procedure TForm3.OrckaIntercept1Message(Sender: TObject; Msg: Integer;
wParam: Cardinal; lParam: Integer);
var
S: string;
MouseMessage: Boolean;
begin
case Msg of
WM_MOUSEMOVE, WM_NCMOUSEMOVE, WM_NCHITTEST, WM_SETCURSOR,
WM_CTLCOLORLISTBOX:
MouseMessage := True;
else
MouseMessage := False;
end;
if not ((MouseMessage) and (CheckBox1.Checked)) then
begin
GetMessageText(Msg, 0, S);
ListBox1.Items.Add(S);
ListBox1.ItemIndex := ListBox1.Items.Count -1;
end;
end;
procedure TForm3.FormCreate(Sender: TObject);
begin
//RadioButton1Click(nil);
end;
procedure TForm3.Button2Click(Sender: TObject);
begin
ListBox1.Clear;
end;
procedure TForm3.RadioButton4Click(Sender: TObject);
begin
OrckaIntercept1.ToWatch := ComboBox1;
end;
end.
--- NEW FILE: Unit1.dfm ---
(This appears to be a binary file; contents omitted.)
|