PDA

Click to See Complete Forum and Search --> : Where can I get the pointing Finger IE Icon


Z
Nov 6th, 1999, 10:47 PM
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

Compwiz
Nov 6th, 1999, 10:52 PM
Look at your {WindowsPath}\Cursors\Hand*.cur

They should be there.

------------------
Tom Young, 14 Year Old
tyoung@stny.rr.com
ICQ: 15743470
AIM: TomY10
PERL, JavaScript and VB Programmer

Serge
Nov 7th, 1999, 10:17 PM
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
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819

Bart
Nov 8th, 1999, 02:58 AM
You just always have to use API's, don't you Yonatan?

lol :)

Yonatan
Nov 8th, 1999, 11:38 AM
This is the best way to get it: (This example sets the hand cursor to Command1)

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: RZvika@netvision.net.il
ICQ: 19552879 (http://www.icq.com/19552879)

Serge
Nov 8th, 1999, 06:04 PM
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
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819




[This message has been edited by Serge (edited 11-09-1999).]