Skip to content

Commit

Permalink
fix & removed starting highlighting in another thread
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-murzinov committed Jun 2, 2014
1 parent 9339f5c commit afb3550
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
13 changes: 5 additions & 8 deletions src/TestStack.White/UIItems/UIItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -431,15 +431,12 @@ public virtual void RaiseClickEvent()
/// </summary>
public virtual void DrawHighlight()
{
new Thread(() =>
{
Rect rectangle = this.AutomationElement.Current.BoundingRectangle;
Rect rectangle = AutomationElement.Current.BoundingRectangle;

if (rectangle != Rect.Empty)
{
new Drawing.FrameRectangle(rectangle).Highlight();
}
}).Start();
if (rectangle != Rect.Empty)
{
new Drawing.FrameRectangle(rectangle).Highlight();
}
}
}
}
4 changes: 1 addition & 3 deletions src/TestStack.White/WindowsAPI/NativeWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,11 @@ public virtual void PostCloseMessage()

[DllImport("user32.dll", CharSet = CharSet.Auto)]
internal static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);

[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
internal static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

[DllImport("user32.dll", CharSet = CharSet.Auto)]
internal static extern int GetWindowLong(IntPtr hWnd, int nIndex);

[DllImport("user32.dll", CharSet = CharSet.Auto)]
internal static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
}
}

0 comments on commit afb3550

Please sign in to comment.