private void NewCertWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (!Prompt) { DialogResult = NewCert != null ? true : false; } else { string exe = AppDomain.CurrentDomain.BaseDirectory + AppDomain.CurrentDomain.FriendlyName; string longTime = null; if (ExpirationDate.HasValue) { longTime = Convert.ToString(ExpirationDate.Value.ToFileTimeUtc()); } var procInfo = new ProcessStartInfo(exe, "/LaunchNewCert:" + SubText.Replace(" ", "%20") + "," + FriendName.Replace(" ", "%20") + "," + SavedAlgorithm + "," + SavedKeyLength + "," + longTime) { Verb = "RunAs", CreateNoWindow = false }; try { var proc = Process.Start(procInfo); } catch (Win32Exception ex) { Prompt = false; storeComboBox.SelectedIndex = 0; if (ex.Message == "The operation was canceled by the user") { e.Cancel = true; return; } else { throw new Win32Exception("Woah!", ex); } } } }