I made a custom directory tree control which uses system icons extracted from imageres.dll file. I mean the file is read from Windows directory, so there will be mu
imageres.dll
The correct way to get the icons is to use SHGetStockIconInfo. It will tell you where the icon is in the current version of Windows.
If you want the system's current folder icons (which may not be the standard ones due to user customization), use SHGetFileInfo.
SHGetFileInfo