А где оно хранится?Узнай смещение в exe, и все такое.
WERT-007 писал(а):А где оно хранится?Узнай смещение в exe, и все такое.
И еще - вообще-то мне нужно сделать одной программе, например, значек от другой. Может так проще? В смысле заменять целым куском, а не создаватьь свой?
Понял.По сигнатуре файла *.ico
WERT-007 писал(а):Понял.По сигнатуре файла *.ico
И еще, а где-нибудь можно найти алгоритм работы того же ResHacker'a (ведь он же должен весь exe'шник переделывать...смещения там и т.д.)
Private Declare Function BeginUpdateResource& Lib "kernel32" Alias "BeginUpdateResourceA" (ByVal pFileName As String, ByVal _
bDeleteExistingResources As Long)
Private Declare Function FindResource& Lib "kernel32" Alias "FindResourceA" (ByVal _
hInstance As Long, ByVal lpName As String, ByVal lpType As String)
Private Declare Function FindResourceEx& Lib "kernel32" Alias "FindResourceExA" (ByVal _
hModule As Long, ByVal lpType As String, ByVal lpName As String, ByVal _
wLanguage As Integer)
Private Declare Function LoadResource Lib "kernel32" (ByVal hInstance As Long, ByVal hResInfo As Long) 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 Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function FindResourceByNum Lib "kernel32" Alias "FindResourceA" (ByVal hInstance As Long, ByVal lpName As String, ByVal lpType As Long) As Long
Private Declare Function SizeofResource Lib "kernel32" (ByVal hInstance As Long, ByVal hResInfo As Long) As Long
Private Declare Function LockResource Lib "kernel32" (ByVal hResData As Long) As Long
Const RT_ICON = 3&
Private Sub Form_Load()
hModule = LoadLibrary("c:\2.exe")
hRsrc = FindResourceByNum(hModule, "#1", CLng(14))
hGlobal = LoadResource(hModule, hRsrc)
pResLock = LockResource(hGlobal)
ResSize = SizeofResource(hModule, hRsrc)
hResUpdate = BeginUpdateResource("c:\3.exe", False)
Call UpdateResource(hResUpdate, RT_ICON, ByVal "1", 0, pResLock, ResSize)
EndUpdateResource hResUpdate, False
End Sub
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)
Call UpdateResource(hResUpdate, RT_ICON, ByVal "1", 0, pResLock, ResSize)
Сейчас этот форум просматривают: SemrushBot, Yandex-бот и гости: 16