thanks Tony
>Is there a way to replace the regular mouse cursor with an
> animated cursor?
>
>thanks Tony
Yes, but to do it properly, you need to subclass the WM_SETCURSOR
message for the window(s) for which you want the cursor displayed
over.
HTH,
Bryan
____________________________________________________________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alp...@mvps.org Hunter S. Thompson -
Microsoft MVP-Visual Basic Fear and Loathing in LasVegas
We need to call APIs to set the animated cursor. The following codes do
this:
Option Explicit
Private Declare Function GetCursor Lib "user32" () As Long
Private Declare Function CopyIcon Lib "user32" (ByVal hIcon As Long) As Long
Private Declare Function LoadCursorFromFile Lib "user32" Alias
"LoadCursorFromFileA" (ByVal lpFileName As String) As Long
Private Declare Function SetSystemCursor Lib "user32" (ByVal hcur As Long,
ByVal id As Long) As Long
Dim tempcurs As Long
Const OCR_NORMAL = 32512
Private Sub ChangeCursor_Click()
Dim MyDir As String
Dim currenthcurs As Long
Dim newhcurs As Long
currenthcurs = GetCursor()
tempcurs = CopyIcon(currenthcurs)
MyDir = "D:\WINNT\CURSORS\dinosaur.ani"
newhcurs = LoadCursorFromFile(MyDir)
SetSystemCursor newhcurs, OCR_NORMAL
End Sub
Private Sub RestoreCursor_Click()
SetSystemCursor tempcurs, OCR_NORMAL
End Sub
--
. . . . . . . . . . . . . . . . . . . . . .
Klaus H. Probst, MVP
http://www.vbbox.com/
Please post/reply to the newsgroup(s)
"Tony V" <nos...@hotmail.com> wrote in message
news:697301c10e44$bbd7eda0$9ae62ecf@tkmsftngxa02...
Private Const OCR_NORMAL = 32512&
Private Declare Function LoadCursor Lib "user32" Alias _
"LoadCursorA" (ByVal hInstance As Long, ByVal _
lpCursorName As Long) As Long
Private Declare Function LoadCursorFromFile Lib _
"user32" Alias "LoadCursorFromFileA" (ByVal lpFileName _
As String) As Long
Private Declare Function SetSystemCursor Lib "user32" _
(ByVal hcur As Long, ByVal id As Long) As Boolean
Private Sub Form_Load()
Dim hcursor As Long, ret_val As Long
hcursor = LoadCursorFromFile("c:\appstart.ani")
ret_val = SetSystemCursor(hcursor, OCR_NORMAL)
End Sub