Article

Another failed attempt to get the icon for the icon for the .. parent folder

Unknown ·The Old New Thing ·Published 2026-11-20 ·5 min read

This article discusses the issues encountered when trying to retrieve the icon for the parent folder using SHGetFileInfo, highlighting the complexities of the shell namespace parsing.

From the article

Last time, we looked at why asking SHGet­File­Info for the icon of .. (the parent folder) produces inconsistent results . One of the things the customer tried was concatenating the .. to the current directory:

SHGetFileInfo(L"C:\\dir\\..", 0, &info, sizeof(info), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_SYSICONINDEX); This in fact made it worse: The function failed!

As I noted last time, if the thing you pass in looks like a relative path, it will be resolved against the current directory. But in this case, the string we passed doesn’t look like a relative path, so no such resolution occurs. The string C:\dir\.. is then sent through the namespace parser.


Share this resource


Discovered 2026-11-23 Source The Old New Thing Archive 2026-11 →