Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Mouse Pointer 1

Status
Not open for further replies.

orna

Programmer
Apr 2, 2002
314
IL
Is it possible to change the mouse pointer to an icon i choose?

TIA
 
Yes.

Unfortunately, I have been using this for some time and have lost the name of the originator. :(

Code:
Public Declare Function LoadCursor Lib "user32" Alias _
    "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Public Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Public Const IDC_HAND = 32649

Function ChangeMouseToHand()

Dim hCur As Long
    
    hCur = LoadCursor(0, IDC_HAND)
    
    If (hCur > 0) Then
        SetCursor hCur
    End If
End Function
 
Thanks Remou
I miss something here, where do i define the icon file?
 
Use PointM from the link in say, the Mouse Move event of a control:

Code:
Private Sub Notes_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call PointM("C:\Docs\Balloons.ico")
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top