|
-
Sep 19th, 2001, 05:36 PM
#1
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?
-
Sep 19th, 2001, 06:09 PM
#2
PowerPoster
Wouldn't the MouseIcon property be enough?
-
Sep 19th, 2001, 06:11 PM
#3
Member
Or Screen.MousePointer = vbHourglass?
-
Sep 20th, 2001, 05:17 PM
#4
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.
-
Sep 20th, 2001, 07:25 PM
#5
Fanatic Member
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.
-
Sep 20th, 2001, 07:28 PM
#6
Member
The VB5 API Text Viewer agrees:
VB Code:
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|