Window Handle

TWindowHandle stores a handle to a native window with methods for simple window manipulation.

Example:

  var
    Win: TWindowHandle;
  begin
    Win := GetActiveWindow();
    WriteLn('Active window: ');
    WriteLn('Title:  ', Win.GetTitle());
    Writeln('PID:    ', Win.GetPID());
    WriteLn('Bounds: ', Win.GetBounds());
  end;

TWindowHandle.Activate

function TWindowHandle.Activate: Boolean;

TWindowHandle.IsValid

function TWindowHandle.IsValid: Boolean;

TWindowHandle.IsActive

function TWindowHandle.IsActive: Boolean;

TWindowHandle.IsVisible

function TWindowHandle.IsVisible: Boolean;

TWindowHandle.GetPID

function TWindowHandle.GetPID: UInt32;

TWindowHandle.GetRootWindow

function TWindowHandle.GetRootWindow: TWindowHandle;

TWindowHandle.GetTitle

function TWindowHandle.GetTitle: String;

TWindowHandle.GetClassName

function TWindowHandle.GetClassName: String;

TWindowHandle.GetTitleW

function TWindowHandle.GetTitleW: WideString;

TWindowHandle.GetClassNameW

function TWindowHandle.GetClassNameW: WideString;

TWindowHandle.GetBounds

function TWindowHandle.GetBounds: TBox;

TWindowHandle.GetChildren

function TWindowHandle.GetChildren(Recursive: Boolean = True): TWindowHandleArray;

TWindowHandle.SetBounds

procedure TWindowHandle.SetBounds(Bounds: TBox);

TWindowHandle.Kill

procedure TWindowHandle.Kill;

GetTopWindows

function GetTopWindows: TWindowHandleArray;

GetVisibleWindows

function GetVisibleWindows: TWindowHandleArray;

GetWindows

function GetWindows: TWindowHandleArray;

GetActiveWindow

function GetActiveWindow: TWindowHandle;

GetDesktopWindow

function GetDesktopWindow: TWindowHandle;

GetWindowAtCursor

function GetWindowAtCursor: TWindowHandle;

FindWindow

function FindWindow(Title: String; out Window: TWindowHandle): Boolean;

FindWindows

function FindWindows(Title: String): TWindowHandleArray;

FindChildWindow

function FindChildWindow(Title: String; ClassName: String; out Child: TWindowHandle): Boolean;

FindChildWindows

function FindChildWindows(Title: String; ClassName: String): TWindowHandleArray;