How to retrieve application icon of a file type ?
-
Hi there, Kindly tell me how to retrieve the application icon of a registered file type from the file extension without having a specific file name. For example, I need to retrieve the application icon associated with file type having extension ".doc". Regards Gaurav:confused: Gaurav Gumber
-
Hi there, Kindly tell me how to retrieve the application icon of a registered file type from the file extension without having a specific file name. For example, I need to retrieve the application icon associated with file type having extension ".doc". Regards Gaurav:confused: Gaurav Gumber
SHGetFileInfo ( ....., SHGFI_ICON ); Iain.
-
Hi there, Kindly tell me how to retrieve the application icon of a registered file type from the file extension without having a specific file name. For example, I need to retrieve the application icon associated with file type having extension ".doc". Regards Gaurav:confused: Gaurav Gumber
HICON GetFileIconHandle(LPCTSTR lpszFileName, BOOL bSmallIcon)
{
UINT uFlags = SHGFI_ICON | SHGFI_USEFILEATTRIBUTES;if (bSmallIcon) uFlags |= SHGFI\_SMALLICON; else uFlags |= SHGFI\_LARGEICON; SHFILEINFO sfi; SHGetFileInfo(lpszFileName, FILE\_ATTRIBUTE\_NORMAL, &sfi, sizeof(SHFILEINFO), uFlags); return sfi.hIcon;
}
HPS HwndSpy - GUI developer's aid to visually locate and inspect windows. For the month of August only, use coupon code CP-81239 for 30% off.