fixed #226: Getting window & control regions will be async so it won't slow down opening of region capture

This commit is contained in:
Jaex 2014-08-08 09:44:18 +03:00
parent 6a3db1d925
commit c5f515f167

View file

@ -24,6 +24,7 @@
#endregion License Information (GPL v3)
using HelpersLib;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
@ -135,10 +136,15 @@ public override void Prepare()
if (AreaManager.WindowCaptureMode)
{
WindowsListAdvanced wla = new WindowsListAdvanced();
wla.IgnoreHandle = Handle;
wla.IncludeChildWindows = AreaManager.IncludeControls;
AreaManager.Windows = wla.GetWindowsRectangleList();
IntPtr handle = Handle;
TaskEx.Run(() =>
{
WindowsListAdvanced wla = new WindowsListAdvanced();
wla.IgnoreHandle = handle;
wla.IncludeChildWindows = AreaManager.IncludeControls;
AreaManager.Windows = wla.GetWindowsRectangleList();
});
}
}
}