Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Win32 icon GUI CURSOR
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.
FindResource(NULL, MAKEINTRESOURCE(IDC_WAIT), RT_CURSOR) does not help.
 
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 Wink | ;-)
Posted 27-Jan-12 8:32am

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

  Print Answers RSS
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 519
2 Maciej Los 305
3 BillWoodruff 250
4 Mathew Soji 195
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,777
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 27 Jan 2012
Copyright © CodeProject, 1999-2014
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