У меня есть настольное приложение. Я добавил меню jumplist. Это меню появляется в Jumplist, когда я нажимаю правой кнопкой мыши значок на панели задач. Проблема в том, что когда я нажимаю на элемент меню, он не выполняет никаких действий (т. Е. Мое приложение его ловит). Я взял код со следующей ссылки и настроил его соответствующим образом (Примечание: этот код jumplist также не работает также на моем компьютере). Я использую Visual Studio 2013 и окна 10.Мое настольное приложение не может поймать событие щелчка jumplist
http://www.codeproject.com/Articles/103913/How-to-Create-a-Custom-Jumplist-with-Custom-Events
В Program.cs я добавил следующий код.
[STAThread]
private static void Main()
{
bool firstInstance = false;
Mutex mtx = new Mutex(true, "Jumplist.demo", out firstInstance);
if (firstInstance)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmSelect());
}
else
{
// Send argument to running window
HandleCmdLineArgs();
}
}
public static void HandleCmdLineArgs()
{
if (Environment.GetCommandLineArgs().Length > 1)
{
switch (Environment.GetCommandLineArgs()[1])
{
case "-1":
MessageBox.Show(@"-1");
break;
case "-2":
MessageBox.Show(@"-2");
break;
case "-3":
MessageBox.Show(@"-3");
break;
}
}
}
}
Myjumplist класс имеет следующий код
public class MYJumpList
{
private JumpList jumpList;
/// <summary>
/// Creating a JumpList for the application
/// </summary>
/// <param name="windowHandle"></param>
public goJumpList(IntPtr windowHandle)
{
TaskbarManager.Instance.ApplicationId = "MyJumplist";
jumpList = JumpList.CreateJumpListForIndividualWindow(TaskbarManager.Instance.ApplicationId, windowHandle);
jumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Recent;
BuildList();
}
public void AddToRecent(string destination)
{
jumpList.AddToRecent(destination);
jumpList.Refresh();
}
/// <summary>
/// Builds the Jumplist
/// </summary>
private void BuildList()
{
JumpListLink jlItem1 = new JumpListLink(Assembly.GetEntryAssembly().Location, "Item1");
jlItem1.Arguments = "-1";
JumpListLink jlItem2 = new JumpListLink(Assembly.GetEntryAssembly().Location, "Item2");
jlItem2.Arguments = "-2";
JumpListLink jlItem3 = new JumpListLink(Assembly.GetEntryAssembly().Location, "Item3");
jlItem3.Arguments = "-3";
jumpList.AddUserTasks(jlItem1);
jumpList.AddUserTasks(jlItem2);
jumpList.AddUserTasks(jlItem3);
jumpList.AddUserTasks(new JumpListSeparator());
jumpList.Refresh();
}
}
Моя основная форма Конструктор имеет следующие Jumplist строки кода
jumpList = new MyJumpList(this.Handle);
Я не знаю, где это неправильно. Пожалуйста, дайте мне любую помощь, чтобы применить Jumplist в моем applicaiton
Используйте опцию редактирования исходного вопроса, чтобы добавить дополнительную информацию. Ответы - это полные ответы, а не дополнительные сведения. – Jacobr365