public editConfig(string aliasObj, string targetObj, string regkeyObj, aliases child) { try { InitializeComponent(); msg = new UDialogs(); textBox1.KeyDown += new KeyEventHandler(RetKey); textBox2.KeyDown += new KeyEventHandler(RetKey); this.alias = aliasObj; this.target = targetObj; this.regkey = regkeyObj; textBox1.Text = alias; textBox2.Text = target; this.Text = "Edit " + alias; if (regkey.Contains("HKEY_CURRENT_USER")) { access = "HKCU"; } else if (regkey.Contains("HKEY_LOCAL_MACHINE")) { access = "HKLM"; } this.inst = child; inst.editDropped = 0; } catch (Exception ex) { msg.ShowError(ex.Message); } }
public about() { try { InitializeComponent(); x = new Form1(); msg = new UDialogs(); label1.Text = x.appname; label2.Text = "version " + x.version; label5.Text = x.copyright; this.FormBorderStyle = FormBorderStyle.FixedSingle; this.MinimizeBox = false; this.MaximizeBox = false; this.StartPosition = FormStartPosition.CenterScreen; this.ShowIcon = false; this.ShowInTaskbar = false; this.Text = "About"; button1.Select(); // this.Size = new System.Drawing.Size(280, 130); } catch (Exception ex) { msg.ShowError(ex.Message); } }
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == Keys.Escape) { UDialogs t = new UDialogs(); if (t.ConfirmAction("Are you sure you want to exit?") == DialogResult.Yes) { this.Close(); return(true); } return(false); } return(base.ProcessCmdKey(ref msg, keyData)); }
public UACDelegate() { try { InitializeComponent(); msg = new UDialogs(); this.SAFE_LOCATION_DIRECTORY = new Form1().SAFE_LOCATION_DIRECTORY; textBox1.KeyDown += new KeyEventHandler(RetKey); textBox2.KeyDown += new KeyEventHandler(RetKey); textBox3.KeyDown += new KeyEventHandler(RetKey); textBox4.KeyDown += new KeyEventHandler(RetKey); checkBox2.KeyDown += new KeyEventHandler(RetKey); checkBox1.KeyDown += new KeyEventHandler(RetKey); } catch (Exception ex) { msg.ShowError(ex.Message); } }
static void Main(String [] args) { //checking for 4libraries in the executing assembly location //when adding new libraries in Form1, rem to perform checks for fail-safe run in the below snippet new FailSafeInit().CheckFailSafe(); UDialogs msg = new UDialogs(); try { var options = new Options(); UDialogs x = new UDialogs(); if (CommandLine.Parser.Default.ParseArguments(args, options)) { if (options.filePath != null) { CommandLineHandler cmdHndl = new CommandLineHandler(); cmdHndl.askUser("Enter alias: (example: apple)", false, "Create file shortcut - EasyRun"); if (!String.IsNullOrEmpty(cmdHndl.userInput) && !cmdHndl.userInput.Contains(" ")) { cmdHndl.CreateFileShortcut(cmdHndl.userInput, options.filePath); } } else if (options.dirPath != null) { CommandLineHandler cmdHndl = new CommandLineHandler(); cmdHndl.askUser("Enter alias: (example: cats)", true, "Create directory shortcut - EasyRun"); if (!String.IsNullOrEmpty(cmdHndl.userInput) && !cmdHndl.userInput.Contains(" ")) { cmdHndl.CreateDirectoryShortcut(cmdHndl.userInput, options.dirPath); } } else if (options.enable == true) { new ExplorerIntegration().CreateIntegration(false); Application.Exit(); } else if (options.removeIntegration == true) { new ExplorerIntegration().DeleteIntegration(); // msg.ShowMessage("Removed Integration"); Application.Exit(); } else { try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } catch (Exception ex) { msg.ShowError(ex.Message); } } } } catch (Exception ex) { msg.ShowError(ex.Message); } }