static int Duck(DuckOptions dopts) { conf.GetInstance().debug = dopts.Verbose; workerw = HWndProvider.GetWorkerWHandle(); foreach (string title in dopts.ToDuck) { IntPtr childWindowHandle = WinApi.FindWindow(null, title); SetParentWindow(childWindowHandle, workerw); } return(0); }
static int UnDuck(UnDuckOptions udopts) { conf.GetInstance().debug = udopts.Verbose; desktopWnd = WinApi.GetDesktopWindow(); workerw = HWndProvider.GetWorkerWHandle(); if (conf.GetInstance().debug) { Console.WriteLine("WorkerW pointer: {0:X}", workerw.ToInt64()); Console.WriteLine("Desktop pointer: {0:X}", desktopWnd.ToInt64()); } foreach (string title in udopts.UnDuck) { IntPtr childWindowHandle = WinApi.FindWindowEx(workerw, IntPtr.Zero, null, title); SetParentWindow(childWindowHandle, desktopWnd); } Clear(new ClearOptions() { Verbose = false }); return(0); }