| 4044 | } |
| 4045 | |
| 4046 | QString 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 | |
| 4070 | QString WindowsSystem::GetFileNameFromIcon(int specialIcon) |
| 4071 | { |
no outgoing calls
no test coverage detected