Hi Andrea,
I run your sample application and do see the problem on my side.
When I click the 'Read Async' button and navigate to a folder that contains
a .sln and a .xml files, the associated icons to the two files are the
standard blank icon.
However, when I click the 'Read Sync' button and navigate to the same
folder, the associated icons to the two files are correct.
I notice that when the application gets the associated icon asynchronous
using the SHGetFileInfo function, the returned iIcon memeber of the
structure specified by the psfi is of value 0, which is not correct.
public static Icon GetAssociatedIcon(string strPath, bool smallIcon)
{
....
int result = SHGetFileInfo(strPath, 0, out info, (uint)cbFileInfo,
flags);
if (info.hIcon != IntPtr.Zero)
{
retIcon = Icon.FromHandle(info.hIcon);
// when the SHGetFileInfo function is called by a thread
other than the UI thread, the info.iIcon memeber returns 0, which is not
correct
int index = info.iIcon;
}
return retIcon;
}
I will go on the research and get the result back to you ASAP.
I appreciate your patience!
Sincerely,
Linda Liu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.