Results 1 to 6 of 6

Thread: Where can I get the pointing Finger IE Icon

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 1999
    Posts
    3

    Post

    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

  2. #2
    Hyperactive Member
    Join Date
    Jul 1999
    Location
    NY, USA
    Posts
    270

    Post

    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

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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



  4. #4
    Lively Member
    Join Date
    Oct 1999
    Posts
    66

    Post

    You just always have to use API's, don't you Yonatan?

    lol

  5. #5
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    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



  6. #6
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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
  •  



Click Here to Expand Forum to Full Width