I am writing a weather application. I am integrating it with the taskbar. When you right click on its icon on the taskbar it show you the current temperature, etc. Currently if you click on the text that says "Current: ..." it opens another instance of the application.
Screenshot:
How can I get this to run a procedure or function in my program? So if the user clicks on the "Current: ..." it should open a new form in the same application. It should not open another application?
My code is currently:
JumpListCustomCategory userActionsCategory = new JumpListCustomCategory("Weather");
userActionLink.Arguments = "-1";
JumpListLink userActionLink = new JumpListLink(Assembly.GetEntryAssembly().Location, Conditions + ": " + reader.ReadToEnd());
userActionLink.IconReference = new IconReference(testicon, 0);
userActionsCategory.AddJumpListItems(userActionLink);
list.AddCustomCategories(userActionsCategory);
list.Refresh();
Look here: The Weekly Source Code 31- Single Instance WinForms. It will allow you to open only one program instance, but using VisualBasic instead of a Mutex.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With