Article

Why do I get inconsistent results when I ask for the icon for the .. parent folder?

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

This article discusses the inconsistencies encountered when retrieving folder icons using the SHGetFileInfo function, particularly when the current directory differs between the developer's environment and the customer's system.

From the article

A customer wanted their program to show a file listing with icons, and they also wanted to include an entry for the parent folder, programmatically known as .. (double period).

Update : The idea is that they are showing a file listing unrelated to the file system. For example, they are an online photo album browser. They want to show all the photos in the current album, plus an icon that means “Go to the parent folder.” End update

They obtained icons by calling the SHGetFileInfo function, but they got weird, inconsistent results when they asked for the icon of the .. parent folder.


Share this resource


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