I am trying to load an icon from an array without success.
I have an array that contains a icon (.ico) in raw and I want to load it. The problem is that the function CreateIconFromResourceEx
returns NULL.
About the icon I saved a .ico file in an array.
This is my code:
HICON icon = NULL;
icon = CreateIconFromResourceEx(tray->icon, (DWORD)tray->fsize, TRUE, 0x30000, 32, 32, LR_DEFAULTCOLOR | LR_DEFAULTSIZE);
if (nid.hIcon) {
DestroyIcon(nid.hIcon);
}
nid.hIcon = icon;
Shell_NotifyIcon(NIM_MODIFY, &nid);
where tray is:
struct tray {
unsigned char *icon;
int fsize;
struct tray_menu *menu;};
What am I doing wrong?