private void CaptureWindow(IntPtr handle) { if (NativeMethods.IsIconic(handle)) { NativeMethods.RestoreWindow(handle); } NativeMethods.SetForegroundWindow(handle); Thread.Sleep(250); editor.LoadImage(ScreenshotHelper.CaptureWindowTransparent(handle)); }