How do I play an animated cursor file in a dialog?


Carry out the following steps:

  1. Build a dialog-based application through AppWizard.
  2. Add a picture control from the control tool bar into the dialog box in the Resource Editor.
  3. Change the properties of the Picture Control: Change the ID of picture control from default ID_STATIC to some other ID, say, ID_PICTURE. Also select ‘Icon’ from the Type option.
  4. Copy the ‘.ani’ file you wish to play into your project.

Create a control variable, m_picture of type CStatic for the inserted picture control through Class Wizard.

Add following code in OnInitDialog( ) :

HCURSOR cursor ;

cursor = ::LoadCursorFromFile ( “Globe.ani” ) ;

m_picture.SetCursor ( cursor ) ;

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>