盘绰网教程:是一个免费提供流行视频软件教程、在线学习分享的学习平台!

用Visual Basic提取图标资源

时间:2024/12/14作者:未知来源:盘绰网教程人气:


[摘要]*.exe"  CommonDialog1.ShowOpen  icon_filename = CommonDialog1.FileName  Picture1.Cls  hmodule ...
*.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 

关键词:  用Visual  Basic提取图标资源





Copyright © 2012-2018 盘绰网教程(http://www.panchuo.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版