![]() |
![]() ![]() ![]() |
acProcess object.
|
property WindowTitle: String; // read-only!
|
The WindowTitle property detemines the caption of the first visible window which belongs to process.
|
|
To retrieve the full list of windows which belongs to the process use Windows property.
|
function TacProcess.GetWindowTitle: String;
|
var
|
I: Integer;
|
begin
|
if AppType = atExplorer then
|
Result := 'Windows Explorer'
|
else
|
if CaseAnsiCompareText(ExtractFilename(FExeName), 'systray.exe') = 0 then
|
Result := 'System tray'
|
else
|
begin
|
Result := '';
|
if High(Windows) >= 0 then // if application have windows
|
begin
|
// Return the window title of the first visible window
|
// whose title is non-empty
|
for I := 0 to High(Windows) do
|
if IsWindowVisible(Windows[I]) then
|
begin
|
Result := acUtils.GetWindowTitle(Windows[I]);
|
if Result <> '' then Exit;
|
end;
|
|
// Nothing yet? Then return the window title of the first
|
// window, visible or otherwise, that is non-empty
|
for I := 0 to High(Windows) do
|
begin
|
Result := acUtils.GetWindowTitle(Windows[I]);
|
if Result <> '' then Exit;
|
end;
|
end;
|
end;
|
end;
|
Windows property.
|