Enhancing Your UFT Testing Agent > Developing Support for Highlighting Objects > Implementing GetRectangle

Implementing GetRectangle

Implement the GetRectangle method to return the coordinates of the rectangle that surrounds the specified object. UFT highlights this rectangle in the application window after switching the focus to the application window. To enable UFT to switch the focus, you must also implement the GetHWND method in the IHWNDSupplier interface.

The following diagram shows the general sequence of methods that UFT calls when a user specifies a test object to highlight in the application. This illustrates the purpose of the methods that the Testing Agent must implement. For example, UFT first calls FindObjectId2 from the ITestable2 interface, then GetHWND from the IHWNDSupplier interface, and finally, GetRectangle from the IRectangleSupplier interface.