Access to system imagelist
I am creating a treeview which wil have folder images for directories and want to know if there is a way to access the system image list so 开发者_Go百科that I can display the system default folder image.
Thx Mark.
There is no out-of-the-box image list for the system images (they depend on things like the current visual theme). The entry for SHGetFileInfo
at pinvoke.net has a code sample for extracting icons for files (and, I presume, folders). You can use that and dynamically populate an ImageList
component to get the tree view display the appropriate icons.
To get the current system icons you should take a look into the registry at HKEY_CLASSES_ROOT\Folder\DefaultIcon
. Here you'll find the path and position of the used folder icon.
精彩评论