File icon bindings are system specific.
In windows you would probably have to use SHGetFileInfo.
Somewhy I have a strong feeling that on X11, this even differs on different desktops.