namespace Simple.DoubleWindow
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Interop;
using System.Windows.Shell;
/// <summary>
/// 双窗口实现核心类 前置窗口为wpf窗口,后置窗口为winfrom窗口
/// </summary>
public class BackgroundWindow : System.Windows.Forms.Form, INotifyPropertyChanged
{
/// <summary>
/// 前置窗口
/// </summary>
public Window ForeWindow { get; private set; }
/// <summary>
/// 记录前置窗口
/// </summary>
protected static readonly List<Window> foreWindows = new List<Window>();
/// <summary>
/// 后置窗口一级容器
/// </summary>
protected Panel panel;
/// <summary>
/// 用于实现双窗口
/// </summary>
/// <param name="hWnd">前置窗口句柄</param>
/// <param name="hWndInsertAfter">窗口的 Z 顺序:
/// 0 hWnd在前面;
/// 1 hWnd在后面;
/// -1 hWnd在前面,且位于任何顶部窗口的前面
/// -2 hWnd在前面,且位于其他顶部窗口的后面
/// </param>
/// <param name="x">hWnd相对于屏幕的坐标x</param>
/// <param name="y">hWnd相对于屏幕的坐标y</param>
/// <param name="cx">hWnd宽度</param>
/// <param name="cy">hWnd高度</param>
/// <param nam
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Interop;
using System.Windows.Shell;
/// <summary>
/// 双窗口实现核心类 前置窗口为wpf窗口,后置窗口为winfrom窗口
/// </summary>
public class BackgroundWindow : System.Windows.Forms.Form, INotifyPropertyChanged
{
/// <summary>
/// 前置窗口
/// </summary>
public Window ForeWindow { get; private set; }
/// <summary>
/// 记录前置窗口
/// </summary>
protected static readonly List<Window> foreWindows = new List<Window>();
/// <summary>
/// 后置窗口一级容器
/// </summary>
protected Panel panel;
/// <summary>
/// 用于实现双窗口
/// </summary>
/// <param name="hWnd">前置窗口句柄</param>
/// <param name="hWndInsertAfter">窗口的 Z 顺序:
/// 0 hWnd在前面;
/// 1 hWnd在后面;
/// -1 hWnd在前面,且位于任何顶部窗口的前面
/// -2 hWnd在前面,且位于其他顶部窗口的后面
/// </param>
/// <param name="x">hWnd相对于屏幕的坐标x</param>
/// <param name="y">hWnd相对于屏幕的坐标y</param>
/// <param name="cx">hWnd宽度</param>
/// <param name="cy">hWnd高度</param>
/// <param nam