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

  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 "shellp.h"
  10. BOOL GetInfoTipHelpEx(IShellFolder* psf, DWORD dwFlags, LPCITEMIDLIST pidl, LPTSTR pszText, int cchTextMax)
  11. {
  12. BOOL fRet = FALSE;
  13. *pszText = 0; // empty for failure
  14. if (pidl)
  15. {
  16. IQueryInfo *pqi;
  17. if (SUCCEEDED(psf->GetUIObjectOf(NULL, 1, &pidl, IID_IQueryInfo, NULL, (void**)&pqi)))
  18. {
  19. WCHAR *pwszTip;
  20. if (SUCCEEDED(pqi->GetInfoTip(dwFlags, &pwszTip)) && pwszTip)
  21. {
  22. fRet = TRUE;
  23. SHUnicodeToTChar(pwszTip, pszText, cchTextMax);
  24. SHFree(pwszTip);
  25. }
  26. pqi->Release();
  27. }
  28. }
  29. return fRet;
  30. }
  31. BOOL GetInfoTipHelp(IShellFolder* psf, LPCITEMIDLIST pidl, LPTSTR pszText, int cchTextMax)
  32. {
  33. return GetInfoTipHelpEx(psf, 0, pidl, pszText, cchTextMax);
  34. }