initial commit
[rofl0r-KOL.git] / units / ipcstreams / ipcstreams_namedpipes_demo / kol_namedpipeclient.pas
blob15f7c8df59cb2090d02265306ac81ad6df060112
1 {-----------------------------------------------------------------------------
2 Unit Name: kol_namedpipeclient
3 Author: Thaddy de Koning
4 Purpose: Demo Named pipe stream
5 History:
6 -----------------------------------------------------------------------------}
9 unit kol_namedpipeclient;
10 //********************************************************************
11 // Created by KOL project Expert Version 2.00 on:17-2-2003 17:12:31
12 //********************************************************************
15 interface
16 uses
17 Windows, Messages, Kol, kolipcstreams;
19 type
21 PForm1=^TForm1;
22 TForm1=object(Tobj)
23 Form:pControl;
24 memo,
25 Button:pControl;
26 NPS:pStream;
27 public
28 procedure BtnClick(sender:pObj);
29 end;
32 procedure NewForm1( var Result: PForm1; AParent: PControl );
34 var
35 Form1:pForm1;
37 implementation
39 procedure NewForm1( var Result: PForm1; AParent: PControl );
40 begin
41 New(Result,Create);
42 with Result^ do
43 begin
44 Form:= NewForm(AParent,'KOL Named pipe Client').SetSize(600,400).centeronparent.Tabulate;
45 Applet:=Form;
46 Form.Add2AutoFree(Result);
47 Memo:=NewEditBox(Form,[]);
48 Memo.width:=300;
49 Button:=NewButton(Form,'Write').PlaceRight.Resizeparent;
50 Button.Onclick:=BtnClick;
51 NPS:=NewNamedPipeWriteStream;//Use default name
52 end;
53 end;
56 procedure Tform1.BtnClick(sender:pObj);
57 begin
58 NPS.WriteStr(Memo.Text);
59 end;
61 end.