Results 1 to 2 of 2

Thread: Getting Icon Problem

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258
    Heres the Code I'm tring to use
    Code:
    Private Sub cmd_Browse_Click()
    
        On Error GoTo this ' Error handling enabled
        
        With cdb
            .DialogTitle = "File to send "
            .InitDir = ConfigurationData.SharedFolder
            .CancelError = True
            .ShowOpen
        
        End With
        
         
                hIcon = ExtractIcon(App.hInstance, cdb.Filename, 0)
                
                ' Only attempt to display the icon if we successfully extracted it.
                    If hIcon = 0 Then
                        Debug.Print "Failed to extract the icon -- aborting."
                End  ' terminate the program
    Else
      
                Retval = DrawIcon(Me.hDC, 0, 0, hIcon)
                ' Although the icon's image is still visible, the icon itself is not in use.
                ' Therefore we destroy it to free up resources.
                Retval = DestroyIcon(hIcon)
    
        
    
    this:
        
        On Error GoTo 0     ' Error handling disabled
    
    End If
    
    
    End Sub
    If I use this
    Code:
     hIcon = ExtractIcon(App.hInstance, "C:\PROGRAM FILES\WINRAR\WINRAR.EXE", 0)
    The Code Continiues with out an error but doesn't display the icon

    It keeps failing . Can you tell me why ?

    []P

    [Edited by PRIVATE1 on 11-10-2000 at 04:26 PM]
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258
    I Got it , I was trying to get the icon from a txt file . It needs to be an EXE or dll .


    []P
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

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