Hello-
I am using the ultraListView to display a list of files along with some other information. I purchased the Infragistics training and went through the tutorials about how to set the icon of the file in the listview by using SHGetFileInfo and that works great. However, I have one problem. In my application, the file list that I am concerned with is stored in a database. So, the user does not have direct access to the file (the files are in a zip archive on the folder, when the user clicks I am extracting that particular file from the zip on the server (for speed issues over VPN).
So, my question is, is it possible to get the icon associated with a particular file extension without having direct access to that file and performing that SHGetFileInfo call?
TIA!!
Yes, there is. I don't know how you got the file icon, but that's what I did to get the file extension icon:
string extension,
{
EnumFileInfoFlags flags =
// add link overlay if requested
}
// set size
else
SHGetFileInfo(
fileType,
conFILE_ATTRIBUTE_NORMAL,
(uint)System.Runtime.InteropServices.Marshal.SizeOf(shellFileInfo),
// deep copy
(System.Drawing.Icon)System.Drawing.Icon.FromHandle(shellFileInfo.hIcon).Clone();
// release handle
DestroyIcon(shellFileInfo.hIcon);