MCPcopy Create free account
hub / github.com/derceg/explorerplusplus / GetInfoTipAsync

Method GetInfoTipAsync

Explorer++/Explorer++/ShellBrowser/ListView.cpp:360–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358}
359
360std::optional<ShellBrowser::InfoTipResult> ShellBrowser::GetInfoTipAsync(HWND listView,
361 int infoTipResultId, int internalIndex, const BasicItemInfo_t &basicItemInfo,
362 const Config &config, HINSTANCE instance, bool virtualFolder)
363{
364 std::wstring infoTip;
365
366 /* Use Explorer infotips if the option is selected, or this is a
367 virtual folder. Otherwise, show the modified date. */
368 if ((config.infoTipType == InfoTipType::System) || virtualFolder)
369 {
370 TCHAR infoTipText[256];
371 HRESULT hr = GetItemInfoTip(
372 basicItemInfo.pidlComplete.get(), infoTipText, SIZEOF_ARRAY(infoTipText));
373
374 if (FAILED(hr))
375 {
376 return std::nullopt;
377 }
378
379 infoTip = infoTipText;
380 }
381 else
382 {
383 TCHAR dateModified[64];
384 LoadString(instance, IDS_GENERAL_DATEMODIFIED, dateModified, SIZEOF_ARRAY(dateModified));
385
386 TCHAR fileModificationText[256];
387 BOOL fileTimeResult =
388 CreateFileTimeString(&basicItemInfo.wfd.ftLastWriteTime, fileModificationText,
389 SIZEOF_ARRAY(fileModificationText), config.globalFolderSettings.showFriendlyDates);
390
391 if (!fileTimeResult)
392 {
393 return std::nullopt;
394 }
395
396 infoTip = str(boost::wformat(_T("%s: %s")) % dateModified % fileModificationText);
397 }
398
399 PostMessage(listView, WM_APP_INFO_TIP_READY, infoTipResultId, 0);
400
401 InfoTipResult result;
402 result.itemInternalIndex = internalIndex;
403 result.infoTip = infoTip;
404
405 return result;
406}
407
408void ShellBrowser::ProcessInfoTipResult(int infoTipResultId)
409{

Callers

nothing calls this directly

Calls 4

GetItemInfoTipFunction · 0.85
LoadStringFunction · 0.85
CreateFileTimeStringFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected