|
-
Aug 10th, 2000, 10:32 AM
#1
Thread Starter
Good Ol' Platypus
Does VB only dislpay 2-Colour mouse cursors? I made 256-colour mouse cursors, and they turn into 2-colour when I load them into VB! Also, VB has no support for animated mouse cursors. Should I just hide the mouse cursor and make a custom one? (DirectDraw Fullscreen App)
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Aug 10th, 2000, 10:39 AM
#2
To use Animated Cursors, insert the following code into a Form with a CommandButton and CommonDialog.
Code:
Private Declare Function LoadCursorFromFile Lib "User32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
Private Declare Function SetClassLong Lib "User32" Alias "SetClassLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GCL_HCURSOR = (-12)
Dim prevCur As Long
Dim MyCursor As Long
Private Sub Command1_Click()
Dim OpenFile As String
CommonDialog1.Filter = "Animated Cursors (*.ani)|*.ani"
CommonDialog1.ShowOpen
OpenFile = CommonDialog1.filename
MyCursor = LoadCursorFromFile(OpenFile)
prevCur = SetClassLong(Me.hwnd, GCL_HCURSOR, MyCursor)
End Sub
Private Sub Form_Unload(Cancel As Integer)
prevCur = SetClassLong(Me.hwnd, GCL_HCURSOR, hOldCursor)
End Sub
-
Aug 10th, 2000, 01:03 PM
#3
Regarding your first question, VB can only display monochrome cursors but if you load an icon instead, it will display it in colours.
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
|