|
-
Nov 6th, 1999, 11:47 PM
#1
Thread Starter
New Member
Where can I get the pointing Finger cursor that shows up when you go over a link in IE? I need to access it from VB I don't actually need the cursor if I can set it in the mouseicon property of a button somehow.
Thanks a lot 
Z
-
Nov 6th, 1999, 11:52 PM
#2
Hyperactive Member
Look at your {WindowsPath}\Cursors\Hand*.cur
They should be there.
------------------
Tom Young, 14 Year Old
[email protected]
ICQ: 15743470
AIM: TomY10
PERL, JavaScript and VB Programmer
-
Nov 7th, 1999, 11:17 PM
#3
I actually offered thid .ico about a week ago, but no one answered. Anyway, if you want this icon, just email me and I'll send it to you.
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
Nov 8th, 1999, 03:58 AM
#4
Lively Member
You just always have to use API's, don't you Yonatan?
lol
-
Nov 8th, 1999, 12:38 PM
#5
Guru
This is the best way to get it: (This example sets the hand cursor to Command1)
Code:
Option Explicit
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Const HKEY_CURRENT_USER = &H80000001
Private Const ERROR_SUCCESS = 0&
Private Const REG_SZ = 1
Private Const KEY_QUERY_VALUE = &H1
Sub StripNulls(ByRef sPath As String)
Dim iPos As Integer
iPos = InStr(sPath, vbNullChar)
If iPos > 0 Then sPath = Left(sPath, iPos - 1)
End Sub
Function GetHandPath() As String
Dim hKey As Long, lSize As Long, sDefault As String
sDefault = String(255, vbNullChar)
Call GetWindowsDirectory(sDefault, 255)
Call StripNulls(sDefault)
If Len(sDefault) > 0 Then If Right(sDefault, 1) <> "\" Then sDefault = sDefault & "\"
sDefault = sDefault & "Cursors\Hand-M.cur"
If Len(Dir(sDefault)) = 0 Then sDefault = ""
If RegOpenKeyEx(HKEY_CURRENT_USER, "Control Panel\Cursors", 0, KEY_QUERY_VALUE, hKey) = ERROR_SUCCESS Then
If RegQueryValueEx(hKey, "Hand", 0, REG_SZ, ByVal 0&, lSize) = ERROR_SUCCESS Then
If lSize < 2 Then
Call RegCloseKey(hKey)
GetHandPath = sDefault
Exit Function
End If
GetHandPath = String(lSize + 1, vbNullChar)
Else
Call RegCloseKey(hKey)
GetHandPath = sDefault
Exit Function
End If
If RegQueryValueEx(hKey, "Hand", 0, REG_SZ, ByVal GetHandPath, lSize) = ERROR_SUCCESS Then
Call StripNulls(GetHandPath)
If Len(Dir(GetHandPath)) = 0 Then GetHandPath = sDefault
Else
GetHandPath = sDefault
End If
Call RegCloseKey(hKey)
Else
GetHandPath = sDefault
End If
End Function
Private Sub Form_Load()
Dim sPath As String
sPath = GetHandPath()
If sPath = "" Then Exit Sub
Command1.MousePointer = vbCustom
Command1.MouseIcon = LoadPicture(sPath)
End Sub
------------------
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879
-
Nov 8th, 1999, 07:04 PM
#6
Yonatan's code doesn't work on NT. Besides, it won't be the same cursor. Don't get me wrong, I'm not trying to put Yonatan down.
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
[This message has been edited by Serge (edited 11-09-1999).]
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
|