public static OpenFileDialog_3C GetOpenFileDialog(int processId) { OpenFileDialog_3C current = null; StringBuilder className = new StringBuilder(256); NativeApi.EnumWindows((hwnd, lParam) => { uint currentProcessId = 0; NativeApi.GetWindowThreadProcessId(hwnd, out currentProcessId); if (currentProcessId == processId) { //保存提示 //提示 if (className.ToString() == "#32770") { current = new OpenFileDialog_3C(hwnd); } } return(current == null); }, IntPtr.Zero); 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); }