only for RuBoard - do not distribute or recompile |
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 .
//------------------------------------------------------ // 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); }
Method | Description |
---|---|
GetInfoFlags [1] | Retrieves the information flags for an item. |
GetInfoTip | Gets the InfoTip text for the file object. |
[1] This method is not currently usednot 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 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:
[in] This parameter is not used currently by the shell.
[in, out] The address of a wide-character string that will receive the pointer to the InfoTip string.
If you haven't figured it out yet, this is the simplest interface in the book. All we need to worry about is one method and one parameter. The shell is basically giving us a buffer and saying, "Put a string in here!" That's all that is happening.
only for RuBoard - do not distribute or recompile |