Last change
on this file was 19, checked in by chronos, 12 years ago |
- Added: Test implementation of custom VCL classes adapted to be used with virtual OS.
|
File size:
947 bytes
|
Line | |
---|
1 | unit Driver.SystemVCL;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Vcl.Forms, Xvcl.Kernel;
|
---|
7 |
|
---|
8 | type
|
---|
9 | TDriverSystemVCL = class(TDriver)
|
---|
10 | private
|
---|
11 | ProcessVCL: TProcess;
|
---|
12 | procedure DoTick(Sender: TObject);
|
---|
13 | procedure DoAfterDriverInit(Sender: TObject);
|
---|
14 | public
|
---|
15 | procedure Initialize; override;
|
---|
16 | procedure Finalize; override;
|
---|
17 | end;
|
---|
18 |
|
---|
19 |
|
---|
20 | implementation
|
---|
21 |
|
---|
22 | { TDriveSystemVCL }
|
---|
23 |
|
---|
24 | procedure TDriverSystemVCL.DoAfterDriverInit(Sender: TObject);
|
---|
25 | begin
|
---|
26 | Application.Run;
|
---|
27 | end;
|
---|
28 |
|
---|
29 | procedure TDriverSystemVCL.Finalize;
|
---|
30 | begin
|
---|
31 | inherited;
|
---|
32 | end;
|
---|
33 |
|
---|
34 | procedure TDriverSystemVCL.Initialize;
|
---|
35 | begin
|
---|
36 | inherited;
|
---|
37 | Application.Initialize;
|
---|
38 | Application.MainFormOnTaskbar := True;
|
---|
39 | Kernel.OnTick := DoTick;
|
---|
40 | end;
|
---|
41 |
|
---|
42 | procedure TDriverSystemVCL.DoTick(Sender: TObject);
|
---|
43 | begin
|
---|
44 | try
|
---|
45 | Application.HandleMessage;
|
---|
46 | except
|
---|
47 | Application.HandleException(Self);
|
---|
48 | end;
|
---|
49 | if Application.Terminated then Kernel.Terminated := True;
|
---|
50 | end;
|
---|
51 |
|
---|
52 | end.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.