0

I'm using the Spy++ for my work with the MS UI Automation Framework, so i wanted to ask you if you know how the search / highlighting gui elements from the spy++ works.

i'm talking about this: https://i.stack.imgur.com/5m1G4.png

you cant see the mouse on the screen, but if you press the left mouse key over a ui component he can read and highlight all the information. I'm sure he uses the fromPoint() function to find the component under the mouse:

System.Windows.Point point = new System.Windows.Point(Cursor.Position.X, Cursor.Position.Y);
AutomationElement element = AutomationElement.FromPoint(point);

but i cant tell how he draws the border. is there a pattern / function in the ui framework ? couldnt find something like this in the framework api only a way with win32 ( ? )

dontcare
  • 935
  • 3
  • 16
  • 34

1 Answers1

1

The rectangle is probably "drawn" on top of the screen using the BoundingRectangle property.

(Just a guess).

Cilvic
  • 3,417
  • 2
  • 33
  • 57
  • the BoundingRectangle helps a lot, so i can get the position and size. Now the question is how they draw on top of the other application, i'm new @ .net GUI Programming. usally you can only draw on your forms ? – dontcare Feb 10 '12 at 13:39
  • You can draw ontop of anything by have a window with transparent background: WindowStyle="None"; ShowInTaskbar="False"; AllowsTransparency="True"; Background="Transparent". – Cilvic Feb 20 '12 at 07:02
  • 1
    It is NOT BoundingRectangle. BoundingRectangle is a rectangle. The highlight of Spy++ successfully follows non-rectangular borders. –  Feb 02 '13 at 06:35