Add to default tooltip in shell extension

I have a shell extension built using SharpShell . I am wondering if you can add to the tooltip that you see when you hover over the file:

enter image description here

I read and tried using the Shell Hip-Tip Handler , but the problem is that it overrides the entire tooltip so that you install it instead of giving you the option to add a line of text to the default tooltip that you usually see, what is my desired result.

I have a feeling that this cannot happen in SharpShell, and as a result, it will help me get an idea from people about how I could additionally approach this problem in MSVC ++ shell extensions.

+6
source share
1 answer

This is possible, but not through the extension of the shell tooltip. Instead, through the shell properties handler. The recipe properties handler is documented here and can be fully downloaded from this repository . Here is his image in action on Windows 10:

enter image description here

It essentially adds additional file properties to the PerfectSteaks.recipe file, registering itself as a property handler, for example, a property for Recipe difficulty , who has the value Microsoft.SampleRecipe.Difficulty and can be easily set in Explorer by changing the HKCR key HKEY_CLASSES_ROOT\SystemFileAssociations\.recipe has an InfoTip (type REG_SZ ) set to prop:System.ItemType;System.Author;System.Rating;Microsoft.SampleRecipe.Difficulty , which causes it to display.

Properties are saved in the file itself. The .recipe file is an XML file that contains, among other things, the actual difficulty that the handler gets:

 <RecipeInfo> <Difficulty>Hard</Difficulty> <PreparationTime>5</PreparationTime> <CookTime>20</CookTime> <Yield>2 servings</Yield> </RecipeInfo> 

This is not unique these days, because many file formats provide some form of additional internal storage API. If you work with Office files (this is me), you may notice that they reveal properties to store in them for saving using OLE. DSOFile.dll ( click here to download the source ) is of most interest to Office files and generally other files. You will see that he is trying to use OLE storage in the Office file format itself, preventing him from trying the Microsoft Office Metadata Handler for storage. If this fails, he finally tries to use alternate streams (not a fan of alternate streams himself, because they will not persist).

Thus, given the combination of a shell properties handler and similar tactics with DSOFile.dll, you can combine the solution to perform this task correctly.

+1
source

All Articles