10.2 InfoTip Interfaces

only for RuBoard - do not distribute or recompile

10.2 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); } 
Table10.1. IQueryInfo



GetInfoFlags [1]

Retrieves the information flags for an item.


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 .

10.2.1 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

Visual Basic Shell Programming
Visual Basic Shell Programming
ISBN: B00007FY99
Year: 2000
Pages: 128

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net