Where can I download this mouse pointer icon?
Anyone know where I can download an icon image of this mouse pointer? I want to use it in a VB program, but they don't have this one built in. I'm gonna have to use it as a custom mouse pointer, but I don't know where to find it as an icon file.
http://www.ipodtouchfans.com/forums/imgcache2/38075.png
Thanks.
Re: Where can I download this mouse pointer icon?
Heres one way to do that...
Code:
Option Explicit
Private Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Private Const IDC_HAND As Long = &H7F89 '32649
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
' set mouse pointer to hand
SetCursor LoadCursor(0, IDC_HAND)
End Sub
1 Attachment(s)
Re: Where can I download this mouse pointer icon?
Well, the hand icons come with VB I believe, it is installed in VB's common\graphics\cursors folder, but I've uploaded them for you if you want to try to use them.
Also, you may want to look at a small project I wrote concerning the Hand icon. It is located on PSC.
Re: Where can I download this mouse pointer icon?
Thanks guys! :)
EDIT: The directory had some hand icons, but not this one. I'll try that code.
Re: Where can I download this mouse pointer icon?
Quote:
Originally Posted by
Edgemeal
Heres one way to do that...
Code:
Option Explicit
Private Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Private Const IDC_HAND As Long = &H7F89 '32649
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
' set mouse pointer to hand
SetCursor LoadCursor(0, IDC_HAND)
End Sub
Thanks for this code, it worked perfectly. But what exactly is this doing? I don't understand where it's getting the hand from.
Re: Where can I download this mouse pointer icon?
How would I write that code for a module? Would I just replace the privates with global?
Re: Where can I download this mouse pointer icon?
Quote:
Originally Posted by
Shaq
How would I write that code for a module? Would I just replace the privates with global?
Yes or replace Private with Public.
Re: Where can I download this mouse pointer icon?
As for how/why the code works: LoadCursor gets a cursor handle from a requested instance such as the system (which is always 0). System has a bunch of predeclared integer values for many of the cursors you see on the system, all those IDC_something constants. You could also load cursors from an attached resource file of your own program, in that case you'd need to pass a String instead of an integer value. This would require a small change into the LoadCursor API call declaration, but since you don't need it now it doesn't matter.
SetCursor then takes the handle that was returned by LoadCursor. As the system cursors are always available, you do not need to free the handle. With resource icons, I think, you need to also free the handle by using DeleteObject API call when the cursor is no longer required.
I don't know whether this confused more than helped but that is somewhat the bare bones explanation.