MCPcopy Create free account
hub / github.com/VioletGiraffe/file-commander / toolTip

Method toolTip

file-commander-core/src/shell/cshell.cpp:303–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303std::wstring OsShell::toolTip(std::wstring itemPath)
304{
305 CO_INIT_HELPER(COINIT_APARTMENTTHREADED);
306
307 std::replace(itemPath.begin(), itemPath.end(), '/', '\\');
308 std::wstring tipString;
309 ITEMIDLIST * id = nullptr;
310 HRESULT result = SHParseDisplayName(itemPath.c_str(), nullptr, &id, 0, nullptr);
311 if (!SUCCEEDED(result) || !id)
312 return tipString;
313 CItemIdListReleaser idReleaser (id);
314
315 LPCITEMIDLIST child = nullptr;
316 IShellFolder * ifolder = nullptr;
317 result = SHBindToParent(id, IID_IShellFolder, reinterpret_cast<void**>(&ifolder), &child);
318 if (!SUCCEEDED(result) || !child)
319 return tipString;
320
321 IQueryInfo* iQueryInfo = nullptr;
322 if (SUCCEEDED(ifolder->GetUIObjectOf(nullptr, 1, &child, IID_IQueryInfo, nullptr, reinterpret_cast<void**>(&iQueryInfo))) && iQueryInfo)
323 {
324 LPWSTR lpszTip = nullptr;
325 CComInterfaceReleaser releaser (iQueryInfo);
326 if (SUCCEEDED(iQueryInfo->GetInfoTip(0, &lpszTip)) && lpszTip)
327 {
328 tipString = lpszTip;
329 CoTaskMemFree(lpszTip);
330 }
331 }
332
333 std::replace(tipString.begin(), tipString.end(), '\r', '\n');
334 return tipString;
335}
336
337bool OsShell::deleteItems(const std::vector<std::wstring>& items, bool moveToTrash, void * parentWindow)
338{

Callers

nothing calls this directly

Calls 3

replaceFunction · 0.85
beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected