Results 1 to 2 of 2

Thread: Animated Icons

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    15

    Angry

    I Need to find some way to display a {*.ANI} Animated
    icon in a picturebox.

    Thanks

  2. #2
    Guest
    Try this. Make a Form with a CommandButton and a CommonDialog and put this code into the Form.

    Code:
    Private Declare Function LoadCursorFromFile Lib "User32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
    Private Declare Function SetClassLong Lib "User32" Alias "SetClassLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Const GCL_HCURSOR = (-12)
    Dim prevCur As Long
    Dim MyCursor As Long
    
    Private Sub Command1_Click()
    
        Dim OpenFile As String
        CommonDialog1.Filter = "Animated Cursors (*.ani)|*.ani"
        CommonDialog1.ShowOpen
        
        OpenFile = CommonDialog1.filename
        
        MyCursor = LoadCursorFromFile(OpenFile)
        prevCur = SetClassLong(Me.hwnd, GCL_HCURSOR, MyCursor)
    
        
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
    
        prevCur = SetClassLong(Me.hwnd, GCL_HCURSOR, hOldCursor)
    
    End Sub

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