Results 1 to 5 of 5

Thread: Cursor

  1. #1

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    I want to set the cursor in my program to C:\winnt\cursors\counter.ani or C:\winnt\cursors\3dgaro.cur , but i get the error Type mismatch!
    What i wrong??
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  2. #2
    Hyperactive Member onerrorgoto's Avatar
    Join Date
    Aug 1999
    Location
    Sweden
    Posts
    330

    Sorry

    From MSDN- MouseIcon property.

    Visual Basic does not load animated cursor (.ani) files, even though 32-bit versions of Windows support these cursors.
    You'll just have to stick with the standard coursors.

    But I hope that VB 7 will support animated cursors.
    Onerrorgoto

    Dont be to optimistic, the light at the end of the tunnel might be a train

  3. #3
    Member
    Join Date
    Mar 2000
    Posts
    32
    I am not sure if you are able to load an ani file or not, but here is the code to load a .cur file.

    Whatever.MouseIcon = LoadPicture"C:winnt\cursors\3dgaro.cur")

    My guess is you forgot the LoadPicture.

  4. #4
    New Member
    Join Date
    May 2000
    Posts
    12

    Talking

    Theres an API with which you can implement animated cursors. The name of the function is LoadCursorFromFile!!!

  5. #5
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    try this code

    Code:
    Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
    Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
    Private Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
    
    
    Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    SetCursor MyCursor
    End Sub
    
    Private Sub Form_Load()
    MyCursor = LoadCursorFromFile("C:\winnt\cursors\counter.ani ")
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
    CloseHandle MyCursor
    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