- Код: Выделить всё
Option Explicit
Private Declare Function ExtractIcon Lib "shell32.dll" Alias _
"ExtractIconA" (ByVal hInst As Long, _
ByVal lpszExeFileName As String, _
ByVal nIconIndex 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 Sub Command1_Click()
Dim hIcon As Long, i As Long
Dim FilePath As String
hIcon = -1
FilePath = "C:\spider.exe"
Picture1.BackColor = vbWhite
Picture1.Height = Screen.TwipsPerPixelY * 32
Picture1.Width = Screen.TwipsPerPixelY * 32
hIcon = ExtractIcon(App.hInstance, FilePath, 0)
Call DrawIcon(Picture1.hdc, 0, 0, hIcon)
End Sub
Получается только большая иконка, а мне надо маленькая.
как это сделать?