ExtractAssociatedIcon
The ExtractAssociatedIcon function returns a handle to an indexed icon found in a file or an icon found in an associated executable file.
HICON ExtractAssociatedIcon(
HINSTANCE hInst, // application instance handle
LPTSTR lpIconPath, // file name
LPWORD lpiIcon // icon index