private void button1_Click(object sender, EventArgs e) { AutoTypeEntry ate = (AutoTypeEntry)comboBox1.SelectedItem; string processInfo = comboBox2.Text; if (ate != null) { int start = processInfo.IndexOf("["); int end = processInfo.IndexOf("]"); int length = (end - start); string processName = processInfo.Substring(start, length); processName = processName.Replace('[', ' '); processName = processName.Replace(']', ' '); processName = processName.Trim(); Process[] pList = Process.GetProcessesByName(processName); if (pList.Length > 0) { Process selectedProcess = null; foreach (Process p in pList) { if (processInfo.Contains(p.MainWindowTitle)) { selectedProcess = p; break; } } if (selectedProcess != null) { string decryptedStr = ate.Decrypt(ate.EncryptedPassword); ShowWindow(selectedProcess.MainWindowHandle, SW_RESTORE); SetForegroundWindow(selectedProcess.MainWindowHandle); SendKeys.Send(decryptedStr); } } } }
private void button3_Click(object sender, EventArgs e) { int index = GetSelectedIndex(); AutoTypeEntry ate = AutoTypeEntryManager.Instance[index]; if (ate != null) { manageEntry.EntryName = ate.Name; manageEntry.EntryValue = ate.Decrypt(ate.EncryptedPassword); if (manageEntry.ShowDialog() == DialogResult.OK) { ate.Name = manageEntry.EntryName; ate.EncryptedPassword = ate.Encrypt(manageEntry.EntryValue); AutoTypeEntryManager.Instance[index] = ate; AutoTypeEntryManager.Instance.Save(); ReloadEntries(); } } }