private void restoreWndList(WndSaveData wd) { IntPtr hwnd = IntPtr.Zero, hactive = IntPtr.Zero; foreach (int wnd in wd.l) { hwnd = new IntPtr(wnd); if (wnd == wd.a) hactive = hwnd; else if (IsWindow(hwnd)) ShowWindowAsync(hwnd, 8/*SW_SHOWNA*/); } if (IsWindow(hactive)) { hwnd = hactive; //while (GetParent(hwnd) != IntPtr.Zero) // hwnd = GetParent(hwnd); ShowWindowAsync(hwnd, 5/*SW_SHOW*/); BringWindowToTop(hwnd); SetForegroundWindow(hwnd); } }
private void updateWndListMove(ref WndSaveData from, ref WndSaveData to, List<int> listMove) { List<int> listFrom = new List<int>(); foreach (int wnd in from.l) { if (!listMove.Contains(wnd)) listFrom.Add(wnd); } from.l = listFrom.ToArray(); List<int> listTo = new List<int>(); foreach (int wnd in to.l) { if (!listTo.Contains(wnd)) listTo.Add(wnd); } foreach (int wnd in listMove) { if (!listTo.Contains(wnd)) listTo.Add(wnd); } to.l = listTo.ToArray(); }
////////////////////////////////////////////////////////// // windows control ////////////////////////////////////////////////////////// private void hideWndList(WndSaveData wd) { foreach (int wnd in wd.l) { IntPtr hwnd = new IntPtr(wnd); ShowWindowAsync(hwnd, 0/*SW_HIDE*/); } }