How can I get the Window Handle of a control that I have interrogated?


You can use a script to get the Window Handle of a Control.

  1. Create a new script method.
  2. In the Using / Imports section add the following;
    using OpenSpan.Adapters.Windows;
  3. The Parameters field should contain the following;
    OpenSpan.Adapters.Controls.Control control
  4. The Result type should be int.
  5. The Method body should contain the following;
    return ((Window) (control.Target)).Handle.ToInt32();

Leave A Comment

or close

Email This Article

or close