Results 1 to 22 of 22

Thread: [RESOLVED] Save Extracted Icon problem

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Resolved [RESOLVED] Save Extracted Icon problem

    Hi ,

    I have Extracted an Icon from an .exe
    its displayed on a PictureBox after i want to save it i get an exception
    invalid property value

    Code:
    Private Sub Command1_Click()
    
    Dim hIcon As Long
    Picture1.AutoRedraw = True
    hIcon = ExtractAssociatedIcon(App.hInstance, "C:\IconChan.exe", 0)
    DrawIcon Picture1.hdc, 0, 0, hIcon
    
    Picture1.Refresh
    
    SavePicture Picture1.Picture, "C:\Icon1.ico"
    
    
    End Sub
    
    Public Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias "ExtractAssociatedIconA" (ByVal hInst As Long, ByVal lpIconPath As String, lpiIcon As Long) As Long
    Public Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
    Thanks !
    Last edited by killer7k; Mar 20th, 2008 at 05:02 PM.

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