- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the best way to animatea cursor in FORTRAN? I'm trying to find references to animating a cursor, but I haven't found anything in either of the books that I have at hand. Does anyone have any recommended sources or suggestions for animating a cursor?
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CASE (WM_TIMER) nframe = nframe + 1 IF (nframe > max_frames) nframe = 1 ! circular progression lret = SetCursor (LoadCursor(NULL, cursorimage(nframe))) lret = SetTimer (hwnd, 1, frame_interval, NULL) res = 1This is a bit crude (I can immediately think of likely circumstances in which the animation would look jerky due to processer loading resulting in uneven frame rates), but may be all you need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
(The intel web editor really sucks, ate most of my post. It seems the src editor feature is really unreliable.)
What preceded my code sample was a suggestion that none of the available fortran-oriented text tell you squat about Win32 programming, they're all worthless wastes of time. What you need to do is sit down with Petzold, translate his examples into F90 and work with them for about 8 months, and you'll be there. This appears to be how everyone learns Windows programming, has nothing to do with whatever language you use.
For an animated cursor, you would presumably createin advance a set of cursor images, and then use a timer to pingthe proc at the frame-change interval so thecursor can be updated to the next frame, in a circular sequence.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Paul you overcomplicated it -- there's no need to do anything special (like WM_TIMER) for an animated cursorcompared witha normal cursor in an application. Thus, a LoadCursor plus handling WM_SETCURSOR will do (just tried it). The animated cursor (.ani) can be included as a resource, like an ordinary .cur file. Just tried it with "banana.ani" from standard Windows set:
Code:
// MyApp.rc IDCUR_BANANA CURSOR DISCARDABLE "C:WinntCursorsbanana.ani"
The only gotcha is that (as far as I know) VS Resource editor does not allow you to draw one -- you'll probably have to find some 3rd-party tool on the web for it (no, I don't know of any offhand).
Jugoslav

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page