I have an application. I would like to add my particular items to the right-click application's taskbar menu via C#. I want to add both permanent items and temporary items.
If I haven't made you to understand, this is the menu I am talking about:
This feature is called a JumpList and is for Windows 7. It is part of the Microsoft API. How to use this with C# has been documented thoroughly here and here.
In order to be able to deal with Jumplist classes in Windows Forms, you'd have to include these DLLs (Microsoft.WindowsAPICodePack.dll and Microsoft.WindowsAPICodePack.Shell.dll) in your project. You can get them from this CodeProject project or you can download the Open source library from WindowsAPICodePack which includes the source code that can be used to access Windows 7 and Windows Vista features. You will need to add two usings at the top of your code:
using Microsoft.WindowsAPICodePack.Taskbar;
using Microsoft.WindowsAPICodePack.Shell;
Any Jumplist consists of categories and each category has its own Jumptasks. There are two types of Jumptasks supported till now by WindowsAPICodePack; the JumplistLink and JumplistSeperator. A Jumptask represents an action to be performed by the user like openning a new instance of the application or launching another program. These Jumptasks are grouped in categories called JumplistCustomCategories.
Related
Scenario
My current O.S. is Windows 8.1 x64, with plans to updgrade to Windows 10 x64 in the near future.
I frequently need to toggle between to show hidden files in explorer.
To solve this, I added a simple contextmenu item via registry, then when I do right click on the background of a folder I have my item that tooggles the hidden files visibility of Explorer.
Problem
Now I would like to make this functionality more accesible to avoid the need of that extra click to open the contextmenu. I would like to integrate the functionality as a shell extension to add a button near the default buttons that are at the bottom-right corner of each Explorer window:
Question
In C# or preferably VB.Net, and preferably using SharpShell library, how can I create a simple shell extension that adds a button with icon there?.
Note that when the button is clicked I need to have some kind of reference to identify the current Window on where I clicked the button.
Research
I've read all the official articles for beginners in this url below, however I didn't found any that talks about integrating an "addon" in Explorer (only about info tips).
Sharpshell - CodeProject
I know the existance of some expecific applications such as QTTabBar that adds functionalities in explorer such as menus and buttons via shell extension, It has a C# source code here and I'd anaylez it but it's a very huge VS solution and my main language is VB.Net, it's very unclear for me what the author do in the source code to add "addons" in the Explorer.
EDIT
AWM (Actual Window Manager) example of its Explorer integration:
QTTabBar's Explorer integration:
I'm trying to do some coded UI tests with Visual Studio 2010 on my SharePoint 2010 site. A particular file in SharePoint launches my Silverlight application in a separate window. I've added the SilerlightUIAutomationHelper assembly as a reference in all my Silverlight projects that run this. This SHOULD allow me to record actions within it, but it pops up with an error message when I try to record inside my Silverlight app:
No Silverlight controls were detected. Verify that the application under test
is built using Silverlight assemblies with a version of 4.0 or greater and that
a reference to the Microsoft.VisualStudio.TestTools.Extension.SilverlightUIAutomationHelper.dll
assembly has been added to the project.
I'm running Silverlight 5.0, so that can't be the issue. I've also verified that the SilverlightUIAutomationHelper dll has made it into the xap package.
I've been able to successfully record these actions in SharePoint 2013/Visual Studio 2012 with this extension: http://visualstudiogallery.msdn.microsoft.com/28312a61-9451-451a-990c-c9929b751eb4
Any idea why this is happening? What can I do to fix it?
In order to do Coded UI tests in Silverlight 5 you need to use update the Coded UI automation helper from here: Visual Studio Gallery: UI Test Plugin for Silverlight The old one that ships with VS2010 works but only on SL4 and bellow.
SL5 was implemented a tad bit differently and it broke the Coded UI tests, therefore prompting devs to switch to VS2012 and the new UI Automation Plugin (as you have discovered).
Once you install the the UITestPluginForSilverlight.msi executable, you need to reference those assemblies in the Silverlight portion of your project (which you already have).
As far as I remember, and the reason why your Coded UI Tests broke in VS2010 but work in VS2012 is because the SL5 and SL4 UIMap.designer.cs files that are generated by the test recorders are not much compatible with each other.
SL4 recordings Generated with SL4 automation helper will not work with SL5 version of the AutiomationHelper. However SL5 Autiomation Helper will work with SL4 recordings if those recordings are generated by VS2012.
So to elaborate: When you use the recorder, it creates a UIMap file. The map file has three portions to it:
XML Listing of all the recorded methods
Designer Generated Code Behind partial class.
A user partial class.
If you inspect the designer generated code behind file, you can actually figure out that the recorder generates a whole lot of code to find the controls and interact with them.
For each control the recorder discovers it declares an instance of the corresponding test/interaction object.
When declaring those objects the recorder defines a bunch of discoverable/searchable properties. The next time the playback executes it takes these properties and uses them to find the actual control.
Also, all controls have a parent, so the recorder mandatory specifies a parent UI element for each discovered control. For SL4 and SL5 the parents are as follows:
Browser Window
HTML Page
Div (holding the silverlight runtime)
SL Object (SL Runtime plugin)
Main SL UI Element (usually the squigly buzy indicator)
Navigation Frames
Internal Pages
Controls
Constructor:
Parent Control/Interaction Object
Search Properties:
Page Title: The total string that is rendered by the browser's window title.
Instance Number: (starts from 1 for lists... which is weird)
Control Id: (defined by the Name or x:Name xaml attributes)
Display Name: This is iffy for combo box/list elements as it works
by combining whatever is rendered in the combo box/list element item combined with the instance number of that item: for example:
A combo box with two items, each named "List Item" may be discovered by the following display names:
"List Item : 1" and "List Item : 2"
Any combination and permutation of search attributes (you can look them up).
So long story short, the actual interaction objects generated by the recorders are different in SL4 and SL5. Meaning you can't take one UIMap.designer.cs and swap it with another. The test framework (and it's associated interaction objects used in the UIMap.designer.cs) are not binary compatible. That's why your playback can't work.
I have created a set of applications which are deployed using clickonce. is it possible to group them in a common start menu item?
Background : I have created a series of quantitative finance related calculators in my website, which are deployed using ClickOnce. All apps are related, and it will be easier to locate them if they are under a common menu item
Set the Publisher Name to the same for all your application, and they'll all appear in a subfolder on the start menu. Here's the description on how to do that in Visual Studio
Also if you are using .NET 3.5 or above, you can fill in the Suite Name field in the Options dialog and it will also group by that.
Is there a way to clean the some items form the Windows Jump-List using C#?
(An applications Jump-List appears when you click right on the applications icon in the Windows 7 Taskbar.)
I would like to clean the menu items representing the recently closed files but I'd like to keep the other menu items.
For example I'd like to clean the items of Google Chromes recently closed websites under the headline "Recently closed". I'd also like to keep the application specific menu items under the headline "Tasks".
All the menu information is stored in some binary files in the directory "%LOCALAPPDATA%\Microsoft\Windows\Recent\CustomDestinations\".
It is possible to delete these files, but if I do so I not only delete the list of recently used files but I also delete the application specific menu items, too.
I'm looking for a way to find and clean the menu items representing the most recently used files for any applicatins Jump-List using C# code. Do you have any ideas?
Thanks for your help!
Maybe it is possible to user the Winodws API Code Pack for C#?
http://code.msdn.microsoft.com/WindowsAPICodePack
My question may be the repeated one here but even after googling i havn't got the solution yet.
I have added a shell context menu item for files i.e. when you right click on a file within explorer the menu shows my custom menu item.
I have used -
HKLM\Software\Classes*\shell\myappname
HKLM\Software\Classes*\shell\myappname\command
But what i am not able to do is to add a separator within that context menu.
I am using C# 2005 for creating my windows application.
Could someone help solve my problem.
Thanks for sharing your valuable time.
You'll need to create a shell context menu handler to take full control over the context menu content. You should not write this in C# until .NET 4.0 becomes widely available. For now you can use C++, this web page has an example. A wrapper is described here, no idea if it is any good.
Check out the following link: Extending Shortcut Menus
I think there is no keyword to add a separator but to create a new entry at the same level. The new set of entries will appear in a new group.