Why do I get inconsistent results when I ask for the icon for the .. parent folder?
cppdashboard.dev/r/2026/11/why-do-i-get-inconsistent-results-when-i-ask-for-the-icon-foThis 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