Results 1 to 6 of 6

Thread: how to change mouse with api in Windows 2000

  1. #1
    larryn
    Guest

    how to change mouse with api in Windows 2000

    this doesn't work in windows 2000


    Code:
    Option Explicit
    Private Declare Function GetCursor Lib "user32.dll" () As Long
    Private Declare Function LoadCursor Lib "user32.dll" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As String) As Long
    Private Declare Function SetCursor Lib "user32.dll" (ByVal hCursor As Long) As Long
    
    Public lArrow As Long      ' get the handle of the arrow cursor
    Public lCursor As Long     ' send the handle of the hourglass cursor
    Public retval As Long      ' return value
    
    Const IDC_WAIT = vbHourglass
    Const IDC_ARROW = vbDefault
    
    
    
    Private Sub Command1_Click()
    
    ' save the handle to the arrow cursor
    lArrow = GetCursor()
    
    ' send the handle of the hourglass cursor
    lCursor = LoadCursor(0, IDC_WAIT)
    
    ' set the cursor to hourglass
    SetCursor (lCursor)
    End Sub
    
    Private Sub Command2_Click()
       ' change hourglass back to the arrow
       SetCursor (lArrow)
    End Sub
    anyone know why?

  2. #2
    PowerPoster eiSecure's Avatar
    Join Date
    Jul 2000
    Location
    Texas
    Posts
    2,209
    Wouldn't the MouseIcon property be enough?

  3. #3
    Or Screen.MousePointer = vbHourglass?

  4. #4
    larryn
    Guest

    yes, i'm aware of these other properties...

    but i need to do it only by using the API calls...

    this is a special case....

    trust me, if i could i would use those other properties.

  5. #5
    Fanatic Member Patoooey's Avatar
    Join Date
    Aug 2001
    Location
    New Jersey, USA
    Posts
    774
    Does your code work for any Windows version ?? Can't get it to work with Win98.

    IDC_WAIT = 32514 according to www.allapi.net and DesaWare API Toolkit.

  6. #6
    The VB5 API Text Viewer agrees:
    VB Code:
    1. Public Const IDC_WAIT = 32514&

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