ExtractIconEx: Heavily Guarded Secret 
Author Message
 ExtractIconEx: Heavily Guarded Secret

In the interest of protecting my address from being scanned and put on a

Seems that no one on the internet (www.dejanews.com) has indicated how to
actually use ExtractIconEx from VB4/32 or VB5. So, I set out to do it on my

I have cracked ExtractIconEx and found out how to grab the small icon for
an executable.

Given you have a Form1 with on it a Picture1 and Picture2, plus have a bas
module, stick this code in your bas module and run it with startup being
set to Main(), not Form1. (That's the way I've implemented it for this
example--not a requirement.)

Declare Sub ExtractIconEx Lib "shell32.dll" Alias "ExtractIconExA" (ByVal
lpszFile As String, ByVal nIconIndex As Long, phiconLarge As Long,
phiconSmall As Long, ByVal nIcons As Long)
Declare Sub DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long,
ByVal y As Long, ByVal hIcon As Long)

Public Sub Main()

    Dim filename$, hIconLarge&, hIconSmall&
    filepath$ = "calc.EXE"
    'note, filepath$ must point to either valid filepath or must indicate a
file in the environment variable for path
    'to find true filepath$, I suggest you do a recursive Dir control
search, which is documented several times on the Internet
    'in www.dejanews.com
    'or, if you are good with FindFirstFile API, have at it
    ExtractIconEx filepath$ & Chr$(0), 0&, hIconLarge&, hIconSmall&, 1&
    Form1.Picture1.AutoRedraw = -1
    Form1.Picture2.AutoRedraw = -1
    DrawIcon Form1.Picture1.hdc, 0&, 0&, hIconLarge&
    DrawIcon Form1.Picture2.hdc, 0&, 0&, hIconSmall&
End Sub

You all can thank me later.
Mike McKee
Raleigh, NC

Wed, 09 Feb 2000 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Is this a guarded Secret?

2. secret secret site

3. secret secret site

4. Object model Guard

5. bypass outlook object guard

6. BETA: Getting Around Guard Model

7. off-topics and the usenet security guards

8. Hiding Directories Like Magic Folders or Folder Guard

9. ExtractIconEx

10. ExtractIconEx

11. ExtractIconEx?

12. ExtractIconEx API call (VB4/Win95)


Powered by phpBB® Forum Software