GetWindowTitle function
|
![]() ![]() ![]() |
acUtils
|
function GetWindowTitle(Wnd: hWnd): String;
|
The GetWindowTitle function retrieves the title of window by its handle.
|
function GetWindowTitle(Wnd: hWnd): String;
|
var
|
WindowTitleLength: Integer;
|
begin
|
WindowTitleLength := GetWindowTextLength(Wnd) + 1;
|
SetLength(Result, WindowTitleLength);
|
if WindowTitleLength <> 1 then
|
Windows.GetWindowText(Wnd, @Result[1], WindowTitleLength);
|
SetLength(Result, WindowTitleLength - 1);
|
end;
|