public static FillDialog_3C GetFillDialog(out string windowType, uint processId) { windowType = null; FillDialog_3C current = null; IntPtr hwnd = GetWindowHandle(IntPtr.Zero, processId); current = new Login_3C(hwnd); current.InitHandle(); if (current.IsValidWindow() == false) { current = new SelectFirmRelation_3C(hwnd); current.InitHandle(); if (current.IsValidWindow() == false) { return(null); } else { windowType = CCCWindowType.FirmWindow; return(current); } } else { windowType = CCCWindowType.LoginWindow; return(current); } }
public static FillDialog_3C GetFillDialog(string type, IntPtr owner, uint processId) { IntPtr hwnd = IntPtr.Zero; FillDialog_3C current = null; if (type == CCCWindowType.AttachWindow) { current = GetAttachWindow(processId); } else if (type == CCCWindowType.SaveWindow) { current = GetSaveDialog(processId); } else { do { System.Threading.Thread.Sleep(500); hwnd = GetWindowHandle(owner, processId); switch (type) { case CCCWindowType.AddWindow: current = new AddWindow(hwnd); break; case CCCWindowType.FirmWindow: current = new SelectFirmRelation_3C(hwnd); break; case CCCWindowType.InfoTipWindow: current = new InfoTips_3C(hwnd); break; case CCCWindowType.InputFileNameWindow: current = new InputFileName_3C(hwnd); break; case CCCWindowType.ListCheckBoxWindow: current = new CheckListBox_3C(hwnd); break; case CCCWindowType.LoginWindow: current = new Login_3C(hwnd); break; case CCCWindowType.MultiValueAndNote: current = new AddValueAndNote(hwnd); break; case CCCWindowType.OpenFileWindow: current = new OpenFileDialog_3C(hwnd); break; case CCCWindowType.PropertyWindow: current = new SelectProperty_3C(hwnd); break; case CCCWindowType.RadioWindow: current = new RadioButtonWindow(hwnd); break; case CCCWindowType.TextWindow: current = new TextEditWindow(hwnd); break; case CCCWindowType.ColumnWindow: current = new ColumnWindow(hwnd); break; } if (current != null) { current.InitHandle(); } } while (_run && (hwnd == IntPtr.Zero || current == null || current.IsValidWindow() == false)); } return(current); }