Need help using ExtractIcon API.
Posted on 1998-04-25
I am writting an applications that extracts the icon from a file. When I
open a file and use the name to extract the icon with the icon index= -1, so
I can get the total number of icons in the file, the return value is NULL.
The following is the code I am using:
pWin->hInst ==== The global instance
pWin->szFile === The path and name of the file, which is taken from the
// Get number of icons in file
lstIcons = ExtractIcon(pWin->hInst, pWin->szFile, -1);
// Display messagebox if there are no icons in file
MessageBox(hwnd,"File doesn't have an icon",
"No Icon", MB_ICONINFORMATION);
Does anyone know if I am doing something wrong. I am using straight C, no
MFC or OWL.