Chapter 10. InfoTip Handler

InfoTip handlers display tool tips, or “info” tips, for a file object on a per-instance basis. You can view this behavior for yourself if you have Microsoft Word installed on your machine. Find a .doc file and select it. Hold the cursor over the file and an InfoTip displaying the author of the document should appear momentarily. Figure 10.1 demonstrates the InfoTip in action.

InfoTip handler for Microsoft Word

Figure 10-1. InfoTip handler for Microsoft Word

InfoTip handlers are usually not considered shell extensions (the Platform SDK says nothing about them), but they are, in fact, just that. They are also very easy to implement.

InfoTip handlers implement IPersistFile (we only have to implement the Load method) and IQueryInfo. IQueryInfo has two methods, but we need to implement only one of them. There are no hoops to jump through this time around. Everything is very straightforward. What a nice change! This chapter will also end our discussion of shell extensions and the RadEx project on which we have been working in the last seven chapters. So let’s get on with it! The InfoTip handler we create will display the animal type associated with the .rad file in the format “Type: (Animal Type).”

How InfoTip Handlers Work

When the cursor is placed over a file object in Explorer, the shell checks the registry under the following key to see if there are any registered InfoTip handlers for that particular ...

Get VB Shell Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.