我测试也获取不了,至于为什么我也不懂,换种用法
全局
Public Declare Function ExtractIconEx Lib "shell32.dll" Alias "ExtractIconEx" (lpszFile As String , niconIndex As Integer, phiconLarge() As Long,phiconSmall() As Long, nIcons As Integer) As Integer
调用,按钮click
Dim appPath = "C:\Program Files (x86)\Tencent\TIM\Bin\QQScLauncher.exe"
Dim IconCount As Integer = ExtractIconEx(appPath , -1, Nothing, Nothing, 0)
Output.Show(IconCount )
Dim largeIcons(IconCount) As Long
Dim smallIcons(IconCount) As Long
ExtractIconEx(appPath, 0, largeIcons,smallIcons, IconCount)
Dim icon = system.drawing.Icon.FromHandle(largeIcons(0))
e.Sender.Image = icon .Tobitmap