Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

39 lines
1.0 KiB

//
// infotip.cpp in shell\lib
//
// common Utility functions that need to be compiled for
// both UNICODE and ANSI
//
#include "stock.h"
#pragma hdrstop
#include "shellp.h"
BOOL GetInfoTipHelpEx(IShellFolder* psf, DWORD dwFlags, LPCITEMIDLIST pidl, LPTSTR pszText, int cchTextMax)
{
BOOL fRet = FALSE;
*pszText = 0; // empty for failure
if (pidl)
{
IQueryInfo *pqi;
if (SUCCEEDED(psf->GetUIObjectOf(NULL, 1, &pidl, IID_IQueryInfo, NULL, (void**)&pqi)))
{
WCHAR *pwszTip;
if (SUCCEEDED(pqi->GetInfoTip(dwFlags, &pwszTip)) && pwszTip)
{
fRet = TRUE;
SHUnicodeToTChar(pwszTip, pszText, cchTextMax);
SHFree(pwszTip);
}
pqi->Release();
}
}
return fRet;
}
BOOL GetInfoTipHelp(IShellFolder* psf, LPCITEMIDLIST pidl, LPTSTR pszText, int cchTextMax)
{
return GetInfoTipHelpEx(psf, 0, pidl, pszText, cchTextMax);
}