Source code of Windows XP (NT5)
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.

40 lines
1006 B

  1. //
  2. // infotip.cpp in shell\lib
  3. //
  4. // common Utility functions that need to be compiled for
  5. // both UNICODE and ANSI
  6. //
  7. #include "stock.h"
  8. #pragma hdrstop
  9. #include <vdate.h>
  10. #include "shellp.h"
  11. BOOL GetInfoTipHelpEx(IShellFolder* psf, DWORD dwFlags, LPCITEMIDLIST pidl, LPTSTR pszText, int cchTextMax)
  12. {
  13. BOOL fRet = FALSE;
  14. *pszText = 0; // empty for failure
  15. if (pidl)
  16. {
  17. IQueryInfo *pqi;
  18. if (SUCCEEDED(psf->GetUIObjectOf(NULL, 1, &pidl, IID_IQueryInfo, NULL, (void**)&pqi)))
  19. {
  20. WCHAR *pwszTip;
  21. if (SUCCEEDED(pqi->GetInfoTip(dwFlags, &pwszTip)) && pwszTip)
  22. {
  23. fRet = TRUE;
  24. SHUnicodeToTChar(pwszTip, pszText, cchTextMax);
  25. SHFree(pwszTip);
  26. }
  27. pqi->Release();
  28. }
  29. }
  30. return fRet;
  31. }
  32. BOOL GetInfoTipHelp(IShellFolder* psf, LPCITEMIDLIST pidl, LPTSTR pszText, int cchTextMax)
  33. {
  34. return GetInfoTipHelpEx(psf, 0, pidl, pszText, cchTextMax);
  35. }