|
-
Feb 25th, 2008, 11:00 PM
#1
[RESOLVED] API - Mouse over hand icon
I know you can set the MouseIcon and MousePointer properties, but I don't want to do that.
Someone (I think RhinoBull?) posted some code using API to automatically show that hand pointer when the mouse hovers over a control. That's what I need.
-
Feb 26th, 2008, 12:32 AM
#2
Re: API - Mouse over hand icon
 Originally Posted by DigiRev
I know you can set the MouseIcon and MousePointer properties, but I don't want to do that.
Someone (I think RhinoBull?) posted some code using API to automatically show that hand pointer when the mouse hovers over a control. That's what I need.
You don't need an API to do that. You can simply put your mouse cursor change code in a Mouse_Move event for the controls in question. All the cursors/icons are in your vb directory including h_point.cur. The MousePointer property also has to be set or coded to (99) Custom.
<--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
If topic has been resolved, please pull down the Thread Tools & mark it Resolved.
Is VB consuming your life, and is that a bad thing?? 
-
Feb 26th, 2008, 12:41 AM
#3
Re: API - Mouse over hand icon
 Originally Posted by CDRIVE
You don't need an API to do that. You can simply put your mouse cursor change code in a Mouse_Move event for the controls in question. All the cursors/icons are in your vb directory including h_point.cur. The MousePointer property also has to be set or coded to (99) Custom.
I don't think the hand is there.
-
Feb 26th, 2008, 12:55 AM
#4
Re: API - Mouse over hand icon
I'm trying to do it without using a MouseIcon. I want the standard "white hand" that you see when hovering over a hyperlink, for example.
I remember the code I saw used the MouseMove event but it didn't require setting any of the MousePointer or MouseIcon properties.
-
Feb 26th, 2008, 06:35 AM
#5
Addicted Member
Re: API - Mouse over hand icon
 Originally Posted by DigiRev
I know you can set the MouseIcon and MousePointer properties, but I don't want to do that.
Someone (I think RhinoBull?) posted some code using API to automatically show that hand pointer when the mouse hovers over a control. That's what I need.
Hi,
If you use API, you'll always have the current system pointer, here's the code:
Code:
' General declaration section
Private Const IDC_HAND = 32649&
Private Const IDC_ARROW = 32512&
Private Const IDC_WAIT = 32514&
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
' MouseOver event where you want the hand...
SetCursor LoadCursor(0, IDC_HAND)
HTH
Jottum™
XpVistaControls , (transparent) usercontrols for XP, Vista and 7 with W2K legacy support.
-
Feb 26th, 2008, 08:30 AM
#6
Re: API - Mouse over hand icon
 Originally Posted by jmsrickland
I don't think the hand is there.
Now that you mention it, I have it there because I used it so often for Mouse_Move events that I probably copied it from my Sys files.
<--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
If topic has been resolved, please pull down the Thread Tools & mark it Resolved.
Is VB consuming your life, and is that a bad thing?? 
-
Feb 26th, 2008, 01:19 PM
#7
Re: API - Mouse over hand icon
Jottum, that's exactly what I was looking for, thanks. 
Code:
Option Explicit
' General declaration section
Private Const IDC_HAND = 32649&
Private Const IDC_ARROW = 32512&
Private Const IDC_WAIT = 32514&
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 Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
SetCursor LoadCursor(0, IDC_HAND)
End Sub
-
Feb 26th, 2008, 01:40 PM
#8
Re: [RESOLVED] API - Mouse over hand icon
That is nice. I'm going back to all my applications where I loaded an icon from the folder and change them to that method.
-
Feb 26th, 2008, 05:38 PM
#9
Re: [RESOLVED] API - Mouse over hand icon
 Originally Posted by jmsrickland
That is nice. I'm going back to all my applications where I loaded an icon from the folder and change them to that method.
Yes, it certainly is! I like this a heck of a lot better than calling the icon from a folder. Do you have any more Hex values for other icons, or can you point us to where to find those values?
<--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
If topic has been resolved, please pull down the Thread Tools & mark it Resolved.
Is VB consuming your life, and is that a bad thing?? 
-
Feb 26th, 2008, 05:43 PM
#10
Re: [RESOLVED] API - Mouse over hand icon
 Originally Posted by CDRIVE
Yes, it certainly is! I like this a heck of a lot better than calling the icon from a folder. Do you have any more Hex values for other icons, or can you point us to where to find those values? 
These are the IDC constants from the API viewer that comes with VB6:
Code:
Private Const IDC_APPSTARTING = 32650&
Private Const IDC_ARROW = 32512&
Private Const IDC_CROSS = 32515&
Private Const IDC_IBEAM = 32513&
Private Const IDC_ICON = 32641&
Private Const IDC_NO = 32648&
Private Const IDC_SIZE = 32640&
Private Const IDC_SIZEALL = 32646&
Private Const IDC_SIZENESW = 32643&
Private Const IDC_SIZENS = 32645&
Private Const IDC_SIZENWSE = 32642&
Private Const IDC_SIZEWE = 32644&
Private Const IDC_UPARROW = 32516&
Private Const IDC_WAIT = 32514&
-
Feb 26th, 2008, 07:04 PM
#11
Re: [RESOLVED] API - Mouse over hand icon
I wonder if it is possible to create your own custom made ones and somehow add them to this list giving them some IDC_MYCUSTOMTHING = nnnnnnn
-
Feb 26th, 2008, 08:22 PM
#12
Re: [RESOLVED] API - Mouse over hand icon
 Originally Posted by DigiRev
These are the IDC constants from the API viewer that comes with VB6:
DigiRev, thank you for the constants. I'll take a tour through the viewer.
<--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
If topic has been resolved, please pull down the Thread Tools & mark it Resolved.
Is VB consuming your life, and is that a bad thing?? 
-
Feb 26th, 2008, 10:19 PM
#13
Re: [RESOLVED] API - Mouse over hand icon
 Originally Posted by jmsrickland
I wonder if it is possible to create your own custom made ones and somehow add them to this list giving them some IDC_MYCUSTOMTHING = nnnnnnn
http://allapi.mentalis.org/apilist/L...FromFile.shtml
-
Feb 27th, 2008, 11:42 AM
#14
Addicted Member
Re: API - Mouse over hand icon
 Originally Posted by DigiRev
Jottum, that's exactly what I was looking for, thanks. 
[...]
You're welcome!
Jottum™
XpVistaControls , (transparent) usercontrols for XP, Vista and 7 with W2K legacy support.
-
May 23rd, 2008, 04:03 PM
#15
New Member
Re: [RESOLVED] API - Mouse over hand icon
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
|