VB下怎样SHELL32.dll里面的图标?
答案:2 悬赏:10 手机版
解决时间 2021-03-10 22:47
- 提问者网友:欺烟
- 2021-03-10 02:36
我用VB设计界面,一些按钮需要加载windows的文件图标,可以从SHELL32.dll里加载吗?如果不能,哪里有下载windows的文件图标的?
最佳答案
- 五星知识达人网友:逃夭
- 2021-03-10 02:58
用resource Hacker 这个软件可从dll.exe,ocx等文件中导出你需要的 ico 图标文件,你迅雷上下就行,操作很简单的
全部回答
- 1楼网友:不甚了了
- 2021-03-10 04:07
帮你改到直接应用到窗口了,加分把
给你完整代码如下:
option explicit
private declare function getmodulehandle lib "kernel32" alias "getmodulehandlea" (byval lpmodulename as string) as long
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 sendmessage lib "user32" alias "sendmessagea" (byval hwnd as long, byval wmsg as long, byval wparam as long, lparam as any) as long
private function seticon(hwnd as long, optional filename as string, optional iconindex as integer) as long
dim hicon as long
hicon = extracticon(getmodulehandle(filename), filename, iconindex)
seticon = sendmessage(hwnd, &h80, 0, byval hicon)
end function
private sub form_load()
seticon me.hwnd, "c:\windows\system32\shell32.dll", 0
end sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯