*.exe"
CommonDialog1.ShowOpen
icon_filename = CommonDialog1.FileName
Picture1.Cls
hmodule = GetModuleHandle(icon_filename) '取得文件句柄
icon_num = ExtractIcon(hmodule, icon_filename, -1) '得到文件内图标总数
HScroll1.Max = icon_num
Label1.Caption = Str(icon_num)
If icon_num - 1 > 0 Then
HScroll1.Enabled = True
Else
HScroll1.Enabled = False
End If
icon_n = ExtractIcon(hmodule, icon_filename, 0) '提取第一个图标
x = DrawIcon(Picture1.hdc, 0, 0, icon_n) '画出图标
If icon_num = 0 Then
HScroll1.Value = 0
Else
HScroll1.Value = 1
End If
Label2.Caption = HScroll1.Value
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub HScroll1_Change()
Picture1.Cls
icon_n = HScroll1.Value
hmodule = GetModuleHandle(icon_filename)
icon_n = ExtractIcon(hmodule, icon_filename, icon_n - 1)
Label2.Caption = HScroll1.Value
x = DrawIcon(Picture1.hdc, 0, 0, icon_n)
End Sub
……