vb中picture控件怎么调用程序里的图标啊

比如:123.exe,能不能picture1.picture=LoadPicture("123.exe内部的图标文件")... 比如:123.exe,能不能
picture1.picture = LoadPicture("123.exe内部的图标文件")
展开
 我来答
棘棘芽
2010-07-18 · TA获得超过563个赞
知道小有建树答主
回答量:608
采纳率:100%
帮助的人:559万
展开全部
下面的方法可以实现,看下应该会用吧!
你上面写的不能,API可以,如下

Option Explicit
Const DI_MASK = &H1
Const DI_IMAGE = &H2
Const DI_NORMAL = DI_MASK Or DI_IMAGE
Private Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias "ExtractAssociatedIconA" (ByVal hInst As Long, ByVal lpIconPath As String, lpiIcon As Long) As Long
Private Declare Function DrawIconEx Lib "user32" (ByVal hdc As Long, ByVal xLeft As Long, ByVal yTop As Long, ByVal hIcon As Long, ByVal cxWidth As Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long, ByVal hbrFlickerFreeDraw As Long, ByVal diFlags As Long) As Long
Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long
Private Sub Picture1_Paint()
Dim mIcon As Long
mIcon = ExtractAssociatedIcon(App.hInstance, "C:\WINDOWS\regedit.exe", 2)
DrawIconEx Picture1.hdc, 0, 0, mIcon, 0, 0, 0, 0, DI_NORMAL
DestroyIcon mIcon
End Sub
百度网友2032eaa
2010-07-18 · TA获得超过809个赞
知道大有可为答主
回答量:2149
采纳率:100%
帮助的人:1825万
展开全部
不能
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式