Reputation: 1021
I created Icon Overlay Handlers using sharpshell as this sample:- http://www.codeproject.com/Articles/545781/NET-Shell-Extensions-Shell-Icon-Overlay-Handlers
My Sharpshell handler is
[ComVisible(true)]
[DisplayName(" Test")]
public class SyncedIconOverlayHandler : SharpIconOverlayHandler
{
...
}
My Question is i want to change the handler name to contain space before name so, my handler will take precedence before Dropbox and Google Drive.
Upvotes: 3
Views: 961
Reputation: 11426
You can as you know append spaces to the name to sort your overlay above others - many common Icon Overlays do e.g. Google Drive, Dropbox and Tortoise SVN.
The precedence in sorting is because only the top 15 as sorted are shown - a limitation in Windows since Windows 95! (And still the case today in Windows 10). If you are competing with Google Drive for instance and both your Icon Overlays are in the top 15 you need to return a lower priority number which you do in SharpShell by overriding GetPriority()
. If you both return the same priority perhaps it is the later as sorted that is then shown? Would have to test..
Using _ as others have suggested is not the way to go, it sorts after space.
What you want to do - specify the name programmatically as opposed to editing the registry manually is not provided by SharpShell - I have the same problem so am going to try add an attirbute that does just that, will update this when I do.
Upvotes: 1
Reputation: 4928
This is not about creating the overlay, this is about the sort order that is used in the list of Overlay Identifiers. To change where your name appears, you would need to change the name of your identifier to start with a letter before D, as DropboxExt1 is the first item. So instead os using " Test"
, give it another name.
Using a space isn't the way to go. A good approach for this is to start the name with the underscore _
character, which will appear in the list before the letter A. this will ensure it remains at the beginning if any future identifiers are added.
Upvotes: 1