I have a desktop application. I added jumplist menu. This menu appears in the Jumplist when I right click on icon on taskbar. The issue is when I click on the menu item it does not perform any action (i.e., my app does catch it). I took code from the following link and customize it accordingly (Note: this code jumplist also does not work also on my pc). I am using Visual Studio 2013 and windows 10.
http://www.codeproject.com/Articles/103913/How-to-Create-a-Custom-Jumplist-with-Custom-Events
In Program.cs i added following code.
[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 class has following code
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();
}
}
My main form constructor has following jumplist code line
jumpList = new MyJumpList(this.Handle);
I don't know where is wrong. Please give me any help to apply jumplist in my applicaiton