ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
AOAndrea Orlando26/09/2017

Hi

I want to set cursor to "wait"  when my VBA MACRO run (SolidWorks 2013); I have tried this code:

Private Const IDC_WAIT As Long = 32512&

Private Const IDC_ARROW As Long = 32514&

Private Declare PtrSafe Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long

Private Declare PtrSafe Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long

Public Function SetCursorToWait(bWait As Boolean)

    If bWait = False Then

        SetCursor LoadCursor(0&, IDC_WAIT)

    Else

        SetCursor LoadCursor(0&, IDC_ARROW)

    End If

End Function

but don't work

Any suggestion ? thanks