MCPcopy Create free account
hub / github.com/bumptop/BumpTop / pGetFileNameFromIcon

Function pGetFileNameFromIcon

trunk/win/Source/BT_WindowsOS.cpp:4046–4068  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4044}
4045
4046QString pGetFileNameFromIcon(int clsid)
4047{
4048 QString name;
4049
4050 LPITEMIDLIST pidl;
4051 if (SUCCEEDED(SHGetSpecialFolderLocation(NULL, clsid, &pidl)))
4052 {
4053 SHFILEINFO fileInfo = {0};
4054 if (SUCCEEDED(SHGetFileInfo((LPCTSTR) pidl,
4055 -1,
4056 &fileInfo,
4057 sizeof(fileInfo),
4058 SHGFI_PIDL | SHGFI_DISPLAYNAME)))
4059 {
4060 name = QString::fromUtf16((const ushort *) fileInfo.szDisplayName);
4061 }
4062
4063 // Release the PIDL
4064 CoTaskMemFree(pidl);
4065 }
4066
4067 return name;
4068}
4069
4070QString WindowsSystem::GetFileNameFromIcon(int specialIcon)
4071{

Callers 2

GetFileNameFromIconMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected