source: cprs/trunk/BDK32/Samples/SharedRPCBroker/SilentSignOn/fXWBAppHandle1.pas@ 1381

Last change on this file since 1381 was 829, checked in by Kevin Toppenberg, 14 years ago

Upgrade to version 27

File size: 2.1 KB
Line 
1unit fXWBAppHandle1;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 StdCtrls, RpcSlogin, Trpcb, RpcConf1, frmVistAAbout, Menus,
8 SharedRPCBroker;
9
10type
11 TForm1 = class(TForm)
12 btnConnect: TButton;
13 btnStartApp2: TButton;
14 edtOtherProgram: TEdit;
15 lblOtherProgram: TLabel;
16 lblOptional: TLabel;
17 lblWithFull: TLabel;
18 Memo1: TMemo;
19 btnExit: TButton;
20 MainMenu1: TMainMenu;
21 File1: TMenuItem;
22 Exit1: TMenuItem;
23 Help1: TMenuItem;
24 About1: TMenuItem;
25 brkrRPCB: TSharedRPCBroker;
26 procedure btnConnectClick(Sender: TObject);
27 procedure btnStartApp2Click(Sender: TObject);
28 procedure btnExitClick(Sender: TObject);
29 procedure Exit1Click(Sender: TObject);
30 procedure About1Click(Sender: TObject);
31 private
32 { Private declarations }
33 public
34 { Public declarations }
35 end;
36
37var
38 Form1: TForm1;
39
40implementation
41
42{$R *.DFM}
43
44
45procedure TForm1.btnConnectClick(Sender: TObject);
46var
47 Server, Port: String;
48begin
49 if btnConnect.Caption = '&Connect' then
50 begin
51 GetServerInfo(Server, Port);
52 brkrRPCB.Server := Server;
53 brkrRPCB.ListenerPort := StrToInt(Port);
54 brkrRPCB.Connected := True;
55 if brkrRPCB.Connected then
56 btnConnect.Caption := '&Disconnect';
57 end
58 else
59 begin
60 brkrRPCB.Connected := False;
61 btnConnect.Caption := '&Connect';
62 end;
63end;
64
65procedure TForm1.btnStartApp2Click(Sender: TObject);
66var
67 CurDir: String;
68begin
69 if edtOtherProgram.Text <> '' then
70 begin
71 CurDir := edtOtherProgram.Text;
72 StartProgSLogin(CurDir,nil);
73 end
74 else
75 begin
76 { Use Test2.exe and expecting it to be in the startup directory for the current application}
77 CurDir := ExtractFilePath(ParamStr(0)) + 'XWBAppHandle2.exe';
78
79 { Now start application with silent login }
80 StartProgSLogin(CurDir, brkrRPCB);
81 end;
82end;
83
84procedure TForm1.btnExitClick(Sender: TObject);
85begin
86 halt;
87end;
88
89procedure TForm1.Exit1Click(Sender: TObject);
90begin
91 Halt;
92end;
93
94procedure TForm1.About1Click(Sender: TObject);
95begin
96 ShowAboutBox;
97end;
98
99end.
Note: See TracBrowser for help on using the repository browser.