mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Added create shortcut function
This commit is contained in:
parent
c45c52cca2
commit
e442c1888c
1 changed files with 17 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue