How can I access to system icons like "folder", "file" etc.?
I would like to use standard icons in tre开发者_Python百科eview but I am not sure where to get them? I tried different places like resources etc., but without luck. thank you
If you're using the treeview to show folders/drives/files then your best bet would be to work with the system image list/SHGetFileInfo. This way you get "native" images on all Windows versions.
In Windows 7 they are held as resources in C:\Windows\system32\imageres.dll
I think older versions of windows had the resources in user32.dll
They are stored as resources in %SystemRoot%\system32\SHELL32.dll
.
Here's a tutorial in how to extract the icons in c#.
Also look at this question: Loading icons from Shell32.dll: Win32 handle is not valid or is the wrong type
精彩评论