Click here to Skip to main content
13,048,584 members (79,635 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I want to draw the default animated cursor (hourglass in XP, circle since vista) on a form.

Theoretically, this is no problem using LoadCursor(NULL, IDC_WAIT) and DrawIconEx with the special parameter istepIfAniCur.
My problem is: How to determine the number of frames of such a system cursor (when to restart?).
The ICONINFOEX structure does not unveil this information.
I think the ICONDIR structure - the first bytes in the raw memory dump of the resource - does contain the number of images. But: How to get the raw resource data for a system / stock object.

I hope, some MFC/Win32-Resource expert has some idea. Thanks in advance !

For all which are wondering why I sometimes refer to icons: In Win32, internally a cursor is only a special kind of icon. A icon resource (or file) contains multiple images, each for a distinct resolution/color depth. An animated cursor contains multiple "frames" which must be displayed cyclically ("thumb cinema").

PS: Why i would do this ? We have a special control displaying tasks (nested) and progresses, and we like to indicate background activity. Of course a marquee progress control could also serve as a "wait indicator", but this simple problem is just challenging me ;-)
Posted 27-Jan-12 7:32am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 27 Jan 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100