Skip to content

Commit afb3550

Browse files
committed
fix & removed starting highlighting in another thread
1 parent 9339f5c commit afb3550

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

src/TestStack.White/UIItems/UIItem.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -431,15 +431,12 @@ public virtual void RaiseClickEvent()
431431
/// </summary>
432432
public virtual void DrawHighlight()
433433
{
434-
new Thread(() =>
435-
{
436-
Rect rectangle = this.AutomationElement.Current.BoundingRectangle;
434+
Rect rectangle = AutomationElement.Current.BoundingRectangle;
437435

438-
if (rectangle != Rect.Empty)
439-
{
440-
new Drawing.FrameRectangle(rectangle).Highlight();
441-
}
442-
}).Start();
436+
if (rectangle != Rect.Empty)
437+
{
438+
new Drawing.FrameRectangle(rectangle).Highlight();
439+
}
443440
}
444441
}
445442
}

src/TestStack.White/WindowsAPI/NativeWindow.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,11 @@ public virtual void PostCloseMessage()
9696

9797
[DllImport("user32.dll", CharSet = CharSet.Auto)]
9898
internal static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
99+
99100
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
100101
internal static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
101102

102103
[DllImport("user32.dll", CharSet = CharSet.Auto)]
103104
internal static extern int GetWindowLong(IntPtr hWnd, int nIndex);
104-
105-
[DllImport("user32.dll", CharSet = CharSet.Auto)]
106-
internal static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
107105
}
108106
}

0 commit comments

Comments
 (0)