diff --git a/Crypto Notepad/Form1.cs b/Crypto Notepad/Form1.cs index c6b4e9b..4c7be5b 100644 --- a/Crypto Notepad/Form1.cs +++ b/Crypto Notepad/Form1.cs @@ -254,6 +254,23 @@ private void MainWindow_FormClosing(object sender, FormClosingEventArgs e) } } + #region Send to Shortcut + public static void SendToShortcut() + { + string shortcutPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Microsoft\Windows\SendTo"; + string shortcutName = "Crypto Notepad" + ".lnk"; + string shortcutLocation = Path.Combine(shortcutPath, shortcutName); + string targetFileLocation = Assembly.GetEntryAssembly().Location; + + WshShell shell = new WshShell(); + IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutLocation); + shortcut.Description = "Crypto Notepad"; + shortcut.IconLocation = targetFileLocation; + shortcut.TargetPath = targetFileLocation; + shortcut.Save(); + } + #endregion + private void MainWindow_Load(object sender, EventArgs e) { string pos = ps.WindowLocation.ToString();