InfoTip Interfaces

InfoTip handlers implement two interfaces: IPersistFile and IQueryInfo. We have discussed IPersistFile several times already, most notably in Chapter 5, so we will jump straight into IQueryInfo. Let’s examine the interface definition, which is shown in Example 10.1. Table 10.1 gives a brief description of each of the methods.

Example 10-1. IQueryInfo

//------------------------------------------------------	
// IQueryInfo
//------------------------------------------------------	
    [
        uuid(00021500-0000-0000-C000-000000000046),
        helpstring("IQueryInfo Interface"),
        odl
    ]
	interface IQueryInfo : IUnknown
	{
		HRESULT GetInfoTip([in] DWORD dwFlags, 
                              [in,out] LPWSTRVB *ppwszTip);

		HRESULT GetInfoFlags([in,out] DWORD *pdwFlags);	
	}

Table 10-1. IQueryInfo

Method

Description

GetInfoFlags [a]

Retrieves the information flags for an item.

GetInfoTip

Gets the InfoTip text for the file object.

[a] This method is not currently used—not here, and according to the Platform SDK, not anywhere.

IQueryInfo is a very basic interface that contains two methods: GetInfoTip and GetInfoFlags. GetInfoFlags is not currently used by the shell, so it will not be discussed. That leaves GetInfoTip.

GetInfoTip

GetInfoTip is called by the shell to request an InfoTip string from the handler. Its syntax is:

HRESULT GetInfoTip( DWORD dwFlags, LPWSTR *ppwszTip );

with the following parameters:

dwFlags

[in] This parameter is not used currently by the shell.

ppwszTip

[in, out] The address of a wide-character ...

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.