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