Results 1 to 8 of 8

Thread: hourglass gif ? anyone ?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2003
    Posts
    599

    hourglass gif ? anyone ?

    Guys,

    Does anyone has hourglass gif animated? i need to make it animate when the program is loading.... please help where can i find it.. ?

    and what is the best way to animate in VB ?
    Thank You

  2. #2
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424
    Animated Cursors
    Attached Files Attached Files

  3. #3
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424

    and this is how we play animated cursors

    VB Code:
    1. ' This code to be inserted into a module
    2.  
    3. Private Declare Function LoadCursorFromFile Lib "user32" Alias _
    4.     "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
    5. Private Declare Function SetSystemCursor Lib "user32" _
    6.     (ByVal hcur As Long, ByVal id As Long) As Long
    7. Private Declare Function GetCursor Lib "user32" () As Long
    8. Private Declare Function CopyIcon Lib "user32" (ByVal hcur As Long) As Long
    9.  
    10. Private Const OCR_NORMAL = 32512
    11.  
    12. Public lngOldCursor As Long, lngNewCursor As Long
    13.  
    14. Public Sub StartAnimatedCursor(AniFilePath As String)
    15.     ' Create a copy of the current cursor,
    16.     ' for Windows NT compatibility
    17.    
    18.     lngOldCursor = CopyIcon(GetCursor())
    19.    
    20.     ' Check the passed string, if it contains
    21.     ' a solid file path, then load the cursor
    22.     ' from file. If not, add the App.Path,
    23.     ' *then* load cursor...
    24.    
    25.     If InStr(1, AniFilePath, "\") Then
    26.         lngNewCursor = LoadCursorFromFile(AniFilePath)
    27.     Else
    28.         lngNewCursor = LoadCursorFromFile(App.Path & _
    29.             "\" & AniFilePath)
    30.     End If
    31.    
    32.     ' Activate the cursor
    33.     SetSystemCursor lngNewCursor, OCR_NORMAL
    34. End Sub
    35.  
    36. Public Sub RestoreLastCursor()
    37.     ' Restore last cursor
    38.     SetSystemCursor lngOldCursor, OCR_NORMAL
    39. End Sub
    40.  
    41. Private Sub Command1_Click()
    42.     StartAnimatedCursor ("C:\Deepak\Downloads\Icons\ani\3db2bus1.ani")
    43.     MsgBox "Start long process here..."
    44.     RestoreLastCursor
    45. End Sub

  4. #4

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2003
    Posts
    599
    actually.. is not the cursor that i want to animate.. i want to animate a picture in the picture box.. can that be done during the registration process?

    Thank You

  6. #6
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424
    u can use WebBrowser ActiveX control to display animated gif file within your program.

  7. #7
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424

    here is how

    Add the WebBrowser ActiveX control to your form. go to Project >> Components, then mark the 'Microsoft Internet Controls' check box, and press OK.

    VB Code:
    1. Private Sub Form_Load()
    2. 'Replace 'C:\myDir\myFile.gif' with your GIF file.
    3. 'the following two lines should be written in one line
    4. WebBrowser1.Navigate "about:<html><body scroll='no'><img src='C:\myDir\myFile.gif'></img></body></html>"
    5. End Sub

  8. #8
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424
    or use this third party dll.

    Copy this file to C:\WINNT\SYSTEM32
    Add it to ur form from Project >> Components
    Attached Files Attached Files

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