var
// globale Variablen zum rausfinden welche Nummer wir wollen und welche wir haben.
I : Integer;
WantedNr : Integer;
iFensterH : THandle;
---------------------------------------------------------
function EnumWindowsProcPrint(
Handle: THandle; udata: longword): Boolean;
stdcall;
begin
SendMessage(
Handle, WM_SETTEXT, 0, integer(PChar('
Nummer ' + IntToStr(I))));
Inc(I);
Result := true;
end;
----------------------------------------------------------
procedure TForm1.Button1Click(Sender: TObject);
begin
iFensterH := findwindow(
nil, '
Fenstername');
I := 0;
if iFensterH <> 0
then EnumChildWindows(iFensterH, @EnumWindowsProcPrint, 0);
end;
---------------------------------------------------------
function EnumWindowsProc(
Handle: THandle; Edit: TEdit): Boolean;
stdcall;
begin
if Assigned(Edit)
and (I = WantedNr)
then
begin
SendMessage(
Handle, WM_SETTEXT, 0, integer(PChar(Edit.Text)));
Result := false;
end
else
begin
Result := true;
Inc(I);
end;
end;