加载时如何更改任务栏中的Excel图标 [英] how to change the Excel Icon in Taskbar while loading
问题描述
免责声明是否有任何选项可以更改Excel任务栏中的excel图标? :我通常不回答OP的表现,但是这样做太过有趣了。但是如果这个问题被关闭,不要惊讶:)
有任何选项可以更改Excel任务栏中的excel图标
是的。您必须为此使用3个API
ExtractIcon32
, GetActiveWindow32
和 SendMessage32
要阅读有关他们的信息,请参阅这个链接。这是我最喜欢的一站API:)
声明函数ExtractIcon32 Libshell32.dllAlias _
ExtractIconA(ByVal hInst As Long,_
ByVal lpszExeFileName As String,ByVal nIconIndex As Long)As Long
声明函数GetActiveWindow32 Libuser32_
别名GetActiveWindow( )As Integer
声明函数SendMessage32 Libuser32别名_
SendMessageA(ByVal hWnd As Long,ByVal wMsg As Long,_
ByVal wParam As Long,ByVal lParam As Long)As Long
Sub Sample()
Dim myIcoFile As String
Dim NewIco
'~~>将其更改为相关图标文件
myIcoFile =D:\Temp\icons\CHARACT\ $ SIGN1.ico
NewIco = ExtractIcon32(0,myIcoFile,0)
SendMessage32 GetActiveWindow32(),& H80,1,NewIco
End Sub
Is there any option to change the excel icon in taskbar for Excel?
Disclaimer: I usually do not answer questions where the OP has shown no efforts but this was way too interesting to pass on. But do not be surprised if this question gets closed :)
Is there any option to change the excel icon in taskbar for Excel
Yes there is. You have to use 3 APIs for this
ExtractIcon32
, GetActiveWindow32
and SendMessage32
To read about them see THIS LINK. This is my favorite one stop for APIs :)
Declare Function ExtractIcon32 Lib "shell32.dll" Alias _
"ExtractIconA" (ByVal hInst As Long, _
ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
Declare Function GetActiveWindow32 Lib "user32" _
Alias "GetActiveWindow" () As Integer
Declare Function SendMessage32 Lib "user32" Alias _
"SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Sub Sample()
Dim myIcoFile As String
Dim NewIco
'~~> Change this to the relevant icon file
myIcoFile = "D:\Temp\icons\CHARACT\$SIGN1.ico"
NewIco = ExtractIcon32(0, myIcoFile, 0)
SendMessage32 GetActiveWindow32(), &H80, 1, NewIco
End Sub
这篇关于加载时如何更改任务栏中的Excel图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!