News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Animated Cursor Demo.

Started by hutch--, October 29, 2010, 10:57:15 PM

Previous topic - Next topic

hutch--

I rarely every needs this type of stuff but its worth knowing how to both create and use animated cursors.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Antariy

Quote from: hutch-- on October 29, 2010, 10:57:15 PM
I rarely every needs this type of stuff but its worth knowing how to both create and use animated cursors.

Attention: there is cursor for Steven Spielberg  :bg



Alex

Antariy

Thank you, Steve - I see, you include the editor, too   :thumbu



Alex

lingo

I'm wondering why do you preserve ebx in MsgLoop? :wink  Should be:
MsgLoop proc
    LOCAL msg:MSG
;    push ebx
    lea ebx, msg
;    jmp getmsg
msgloop:
    invoke TranslateMessage, ebx
    invoke DispatchMessage,  ebx
;getmsg:
    invoke GetMessage,ebx,0,0,0
    test eax, eax
    jnz msgloop
;    pop ebx
    ret

hutch--

Lingo,

EBX is specified in the Intel ABI as needing to be preserved.

This would be the preferred code form if it in fact mattered. I have seen problems in the past with not calling GetMessage() before the other two calls so I ensure it runs first.


MsgLoop proc

    LOCAL msg:MSG

    push ebx
    lea ebx, msg
    invoke GetMessage,ebx,0,0,0

  msgloop:
    invoke TranslateMessage, ebx
    invoke DispatchMessage,  ebx
    invoke GetMessage,ebx,0,0,0
    test eax, eax
    jnz msgloop

    pop ebx
    ret

MsgLoop endp
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

lingo

Only CALLBACK procs, specified by the MSDN, need preserving the EBX,ESI,EDI registers if you will modify them...but MsgLoop and Main are not  CALLBACK procs! :wink

dedndave

i am sure this is something simple
i have no definition of VOS__WINDOWS32

Microsoft (R) Windows (R) Resource Compiler, Version 5.00.1823.1 - Build 1823
Copyright (C) Microsoft Corp. 1985-1998. All rights reserved.

Using codepage 1252 as default
Creating rsrc.RES
RC: RCPP -CP 1252 -f C:\Documents and Settings\Dave\Desktop\masm_snippets\ani\RC
a02556 -g C:\Documents and Settings\Dave\Desktop\masm_snippets\ani\RDa02556 -DRC
_INVOKED -D_WIN32 -pc\:/ -E -I. -I .

rsrc.rc.
Writing 24:1,   lang:0x409,     size 441.
Writing ICON:1, lang:0x409,     size 744
Writing GROUP_ICON:500, lang:0x409,     size 20.
Writing ANICURSOR:950,  lang:0x409,     size 249600.rsrc.rc (17): error RC2104 :
undefined keyword or key name: VOS__WINDOWS32

Microsoft (R) Windows Resource To Object Converter Version 5.00.1736.1
Copyright (C) Microsoft Corp. 1992-1997. All rights reserved.

CVTRES : fatal error CVT1101: cannot open rsrc.res for reading

Coma

/* ----- VS_VERSION.dwFileOS ----- */
#define VOS_UNKNOWN             0x00000000L
#define VOS_DOS                 0x00010000L
#define VOS_OS216               0x00020000L
#define VOS_OS232               0x00030000L
#define VOS_NT                  0x00040000L
#define VOS_WINCE               0x00050000L

#define VOS__BASE               0x00000000L
#define VOS__WINDOWS16          0x00000001L
#define VOS__PM16               0x00000002L
#define VOS__PM32               0x00000003L
#define VOS__WINDOWS32          0x00000004L

#define VOS_DOS_WINDOWS16       0x00010001L
#define VOS_DOS_WINDOWS32       0x00010004L
#define VOS_OS216_PM16          0x00020002L
#define VOS_OS232_PM32          0x00030003L
#define VOS_NT_WINDOWS32        0x00040004L


defined in WinVer.h
Coma Homepage 20:00-23:00 GMT+2 --- http://ge2001.dyndns.org:44792

Magnum

Thanks Hutch.

The demo also works on XP Home Edition Sp2.

Have a great day,
                         Andy