Newer
Older
JumpListUtil / SetLnkApp / MainForm.cs
using ShellLinkPlus;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SetLnkApp
{
    public partial class MainForm : Form
    {
        private ShellLink shortcut;
        public MainForm(ShellLink shortcut)
        {            
            InitializeComponent();

            this.shortcut = shortcut;
            this.path.Text = shortcut.ShortcutFile;
            this.oldApp.Text = shortcut.AppUserModelID;
        }

        private void appUserModelId_KeyDown_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return)
            {
                e.SuppressKeyPress = true;
                setButton.PerformClick();
            }
        }

        private void setButton_Click(object sender, EventArgs e)
        {
            shortcut.AppUserModelID = appUserModelId.Text.Trim();
            shortcut.Save();

            Close();
        }
    }
}