function FindWindowEx2(hParent: HWND; ChildClassName:
string; ChildNr: Word): HWND;
var
i: Word;
hChild: HWND;
begin
hChild := 0;
Result := 0;
Dec(ChildNr);
for i := 0
to ChildNr
do
begin
hChild := FindWindowEx(hParent, hChild, PChar(ChildClassName),
nil);
if hChild = 0
then
Break;
Result := hChild;
end;
end;
procedure TForm5.Button1Click(Sender: TObject);
var
wndMain, wndChild: HWND;
begin
wndMain := FindWindow('
TAppBuilder',
nil);
if wndMain <> 0
then
begin
wndChild := FindWindowEx(wndMain, 0, '
TEditorDockPanel',
nil);
wndChild := FindWindowEx(wndChild, 0, '
TEditWindow',
nil);
wndChild := FindWindowEx(wndChild, 0, '
TPanel',
nil);
wndChild := FindWindowEx(wndChild, 0, '
TPanel',
nil);
wndChild := FindWindowEx2(wndChild,'
TPanel', 2);
wndChild := FindWindowEx(wndChild, 0, '
TPanel',
nil);
wndChild := FindWindowEx(wndChild, 0, '
TPanel',
nil);
wndChild := FindWindowEx(wndChild, 0, '
TPanel',
nil);
wndChild := FindWindowEx(wndChild, 0, '
TEditControl',
nil);
if wndChild <> 0
then
begin
SendMessage(wndChild, WM_COPYDATA, 0, LongInt(PChar('
Eingefügt')));
ShowMessage('
Window Handle: ' + IntToStr(wndChild));
end;
end;
end;