Is there any way to embed Icons from Shell32 into an Access application?
Ideally I'd like to have them stored as images (perhaps in an ImageList) but it doesn't really matter, as long as I can use them in the application. It appears that the following code is CLOSE to what I want, but I can't adapt it to VBA since I have a limited knowledge of VB and APIs
Private Declare Function ExtractIconEx Lib "shell32.dll" Alias "ExtractIconExA" _
(ByVal lpszFile As String, ByVal nIconIndex As Long, phiconLarge As Long, phiconSmall As Long, ByVal nIcons As Long) As Long
Private Declare Function DrawIcon Lib "user32" _
(ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Private Declare Function DestroyIcon Lib "user32" _
(ByVal hIcon As Long) As Long
Private Sub Form_Load()
Dim mIcon As Long
Dim n As Integer, iCount As Long
Dim xPos As Long, yPos As Long
iCount = ExtractIconEx("C:\Windows\System32\Shell32.dll", -1, 0&, 0&, 1)
For n = 0 To iCount
ExtractIconEx "C:\Windows\System32\Shell32.dll", n, mIcon, 0&, 1&
DrawIcon Me.hwnd, 0, 0, mIcon
DestroyIcon mIcon
xPos = xPos + 32
xPos = 0
yPos = yPos + 32
Next n
End Sub