acoustic писал(а):VB6 тоже свою иконку пихает
Я ResHacker'ом обычно режу
H = BeginUpdateResource(exepath, False)
Dim B() As Byte
ReDim B(0 To FileLen(icopath) - 1)
Open icopath For Binary As #1
Get #1, , B()
Close #1
Call UpdateResource(H, RT_ICON, 30001, 0, B(22), UBound(B) - 21)
Erase B
ReDim B(0 To FileLen(headerpath) - 1)
Open headerpath For Binary As #1
Get #1, , B()
Close #1
Call UpdateResource(H, RT_GROUP_ICON, 1, 0, B(0), 20)
Call EndUpdateResource(H, False)
Private Const RT_ICON = 3&
Private Const RT_GROUP_ICON = 14&
Private Declare Function BeginUpdateResource& Lib "kernel32" Alias "BeginUpdateResourceA" (ByVal pFileName As String, ByVal _
bDeleteExistingResources As Long)
Private Declare Function UpdateResource& Lib "kernel32" Alias "UpdateResourceA" (ByVal _
hUpdate As Long, ByVal lpType As String, ByVal lpName As String, ByVal _
wLanguage As Long, lpData As Any, ByVal cbData As Long)
Private Declare Function EndUpdateResource& Lib "kernel32" Alias "EndUpdateResourceA" _
(ByVal hUpdate As Long, ByVal fDiscard As Long)
Private Const RT_ICON = 3&
Private Const RT_GROUP_ICON = 14&
Private Sub Form_Load()
exepath = "c:\project1.exe"
icopath = "c:\1.ico"
headerpath = "c:\32x32(256).header"
H = BeginUpdateResource(exepath, False)
Dim B() As Byte
ReDim B(0 To FileLen(icopath) - 1)
Open icopath For Binary As #1
Get #1, , B()
Close #1
Call UpdateResource(H, RT_ICON, 30001, 0, B(22), UBound(B) - 21)
Erase B
ReDim B(0 To FileLen(headerpath) - 1)
Open headerpath For Binary As #1
Get #1, , B()
Close #1
Call UpdateResource(H, RT_GROUP_ICON, 1, 0, B(0), 20)
Call EndUpdateResource(H, False)
End Sub
vitas123 писал(а):
- Код: Выделить всё
ByVal lpType As String
Private Declare Function BeginUpdateResource& Lib "kernel32" Alias "BeginUpdateResourceA" (ByVal pFileName As String, ByVal _
bDeleteExistingResources As Long)
Private Declare Function UpdateResource& Lib "kernel32" Alias "UpdateResourceA" (ByVal _
hUpdate As Long, ByVal lpType As Any, ByVal lpName As String, ByVal _
wLanguage As Long, lpData As Any, ByVal cbData As Long)
Private Declare Function EndUpdateResource& Lib "kernel32" Alias "EndUpdateResourceA" _
(ByVal hUpdate As Long, ByVal fDiscard As Long)
Private Const RT_ICON = 3&
Private Const RT_GROUP_ICON = 14&
Private Sub Form_Load()
exepath = "c:\3.exe"
icopath = "c:\1.ico"
headerpath = "c:\32x32(256).header"
H = BeginUpdateResource(exepath, False)
Dim B() As Byte
ReDim B(0 To FileLen(icopath) - 1)
Open icopath For Binary As #1
Get #1, , B()
Close #1
Call UpdateResource(H, RT_ICON, 1, 3081, B(22), UBound(B) - 21)
Erase B
ReDim B(0 To FileLen(headerpath) - 1)
Open headerpath For Binary As #1
Get #1, , B()
Close #1
Call UpdateResource(H, RT_GROUP_ICON, 1, 3081, B(0), 20)
Call EndUpdateResource(H, False)
End Sub
И икон и гроуп икон добавляется, но значок не изменяется.
Сейчас этот форум просматривают: SemrushBot и гости: 67