public Form1() { InitializeComponent(); var handler = User32_Gdi.FindWindow("#32770", "Windows 任务管理器"); if (!handler.IsNull) { User32_Gdi.SetParent(handler, new HWND(Handle)); } }
internal static HWND IWin2Ptr(System.Windows.Forms.IWin32Window wnd, bool desktopIfNull = true) => wnd?.Handle ?? User32_Gdi.FindWindow("Progman", null);
internal static IntPtr IWin2Ptr(System.Windows.Forms.IWin32Window wnd, bool desktopIfNull = true) { return(wnd == null?User32_Gdi.FindWindow("Progman", null) : (IntPtr) new HandleRef(wnd, wnd.Handle)); }