Results 1 to 12 of 12

Thread: [RESOLVED] Animated cursors

Threaded View

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    Resolved [RESOLVED] Animated cursors

    i found these function in net for read animated cursors, but the real one change the system cursor. but i wanted put(draw) the subimages in a picturebox array.
    in my new changes i have incompleted DrawIconEx(i don't know use these API function) arguments.
    and i don't know if there is more errors.
    can anyone help me finish these function?

    Code:
    Option Explicit
    
    Private Declare Function LoadCursorFromFile Lib "user32" Alias _
        "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
    Private Declare Function GetCursor Lib "user32" () As Long
    Private Declare Function CopyIcon Lib "user32" (ByVal hcur As Long) As Long
    Private mlngOldCursor As Long, lngNewCursor As Long
    Private Declare Function DrawIconEx Lib "user32" (ByVal hdc As Long, ByVal xLeft As Long, ByVal yTop As Long, ByVal hIcon As Long, ByVal cxWidth As Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long, ByVal hbrFlickerFreeDraw As Long, ByVal diFlags As Long) As Long
    
    
    Public Sub AnimatedCursor(AniFilePath As String, picDestany As Variant)
        Static i As Long
        i = i + 1
        'Create a copy of the current cursor,    'for Windows NT compatibility
        mlngOldCursor = CopyIcon(GetCursor())
        'Check the passed string, if it contains
        'a solid file path, then load the cursor
        'from file. If not, add the App.Path,    '*then* load cursor...
        If InStr(1, AniFilePath, "\") Then
            lngNewCursor = LoadCursorFromFile(AniFilePath)
        Else
            lngNewCursor = LoadCursorFromFile(App.Path & _
                "\" & AniFilePath)
        End If        'Activate the cursor
        Load picDestany(i)
        drawiconex picDestany(i).hdc,0,0, lngNewCursor,
    End Sub
    thanks
    Last edited by joaquim; May 1st, 2008 at 02:50 PM.
    VB6 2D Sprite control

    To live is difficult, but we do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width