title: Load an animated cursor at runtime from memory
body: <p>I want to load an animated cursor stored in .ani format, which is described to be a RIFF archive/container, from memory without writing the memory to a temporary file. Thus far I am able to parse the .ani file structure and load the individual frames as a normal icon with the aid of <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms648061%28v=vs.85%29.aspx" rel="nofollow noreferrer">CreateIconFromResourceEx</a> <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms648074%28v=vs.85%29.aspx" rel="nofollow noreferrer">LookupIconIdFromDirectoryEx</a></p>
  
  <p>One of the problems that proofs difficult is the actual composition of these frames and the animation data (jiffy-rate etc) as there appears to be no entries in the Windows API to do so. Documentation or written knowledge over the subject seems to be limited to loading non-animated icons/cursors from memory.</p>
  
  <p>Similar questions such as <a href="https://stackoverflow.com/questions/3498898/load-an-embedded-animated-cursor-from-the-resource">'Load an embedded animated Cursor from the Resource'</a> express the desire to load an animated cursor from an embeddable resource. However i am not able to reproduce a workable solution from that either. Partly because the resource compiler in visual studio 2008 &amp; 2010 doesn't support .ani (only ico and cur) files and therefor embedding it simply results in a 1:1 copy of the bytes as they were in the original file as opposed to .cur and .ico files which get decomposed into multiple resources. The subsequent call to CreateIconFromResource as shown in both answers does not work because the data it expects is the icon/cursor data of a single directive in a icon archive and not a RIFF-based file structure.</p>
  
  <p>To summarize I'm interested in any information regarding the structures of animated cursors (in memory) or otherwise relevant pointers that could assist me in pursuing my goal.</p>