-
Notifications
You must be signed in to change notification settings - Fork 0
/
p_FrmAdoReconBase.pas
59 lines (48 loc) · 1.26 KB
/
p_FrmAdoReconBase.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
unit p_FrmAdoReconBase;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
const
WM_ADOReCon = WM_USER + 120;
type
TfrmAdoReconBase = class(TForm)
private
procedure BroadMsgtoAllChildren(AMsg: Cardinal; AwParam, AlParam: Integer);
procedure WMAdoRestore(var message: TMessage); message WM_ADOReCon;
protected
public
end;
var
frmAdoReconBase: TfrmAdoReconBase;
CTestInfo: string;
implementation
{$R *.dfm}
{ TfrmAdoReconBase }
procedure TfrmAdoReconBase.BroadMsgtoAllChildren(AMsg: Cardinal; AwParam,
AlParam: Integer);
var
I: integer;
CfrmName, CfrmClassName: string;
AHandle: THandle;
begin
for I := 0 to Screen.FormCount - 1 do
begin
if (Screen.Forms[I].InheritsFrom(Self.ClassType)) and (Screen.Forms[I] <>
Self) then
begin
CfrmName := Screen.Forms[I].Name;
CfrmClassName := Screen.Forms[I].ClassName;
Ahandle := FindWindow(PAnsiChar(CfrmClassName),
pchar(CfrmName));
// Screen.Forms[I].Perform(AMsg, AwParam, AlParam);
SendMessage(AHandle,AMsg, AwParam, AlParam);
end;
end;
end;
procedure TfrmAdoReconBase.WMAdoRestore(var message: TMessage);
begin
CTestInfo := self.ClassName;
BroadMsgtoAllChildren(WM_ADOReCon, 0, 0);
end;
end.