Как можно редактировать рессурсы в ME и ниже?
... << RSDN@Home 1.0 beta 6a >>
Здравствуйте, nap2k, Вы писали:
N>Как можно редактировать рессурсы в ME и ниже?
The BeginUpdateResource function returns a handle that can be used by the UpdateResource function to add, delete, or replace resources in an executable file.
HANDLE BeginUpdateResource( LPCTSTR pFileName,
BOOL bDeleteExistingResources
);
Parameters
pFileName
[in] Pointer to a null-terminated string that specifies the executable file in which to update resources. An application must be able to obtain write access to this file; it cannot be currently executing. If pFileName does not specify a full path, the system searches for the file in the current directory.
bDeleteExistingResources
[in] Specifies whether to delete the pFileName parameter's existing resources. If this parameter is TRUE, existing resources are deleted and the updated executable file includes only resources added with the UpdateResource function. If this parameter is FALSE, the updated executable file includes existing resources unless they are explicitly deleted or replaced by using UpdateResource.
Return Value
If the function succeeds, the return value is a handle that can be used by the UpdateResource and EndUpdateResource functions. The return value is NULL if the specified file is not an executable file, the executable file is already loaded, the file does not exist, or the file cannot be opened for writing. To get extended error information, call GetLastError.
--------------
The UpdateResource function adds, deletes, or replaces a resource in an executable file.
BOOL UpdateResource( HANDLE hUpdate,
LPCTSTR lpType,
LPCTSTR lpName,
WORD wLanguage,
LPVOID lpData,
DWORD cbData
);
Parameters
hUpdate
[in] Specifies an update-file handle. This handle is returned by the BeginUpdateResource function.
lpType
[in] Pointer to a null-terminated string specifying the resource type to be updated. This parameter can also be an integer value passed to the MAKEINTRESOURCE macro, or it can be a predefined resource type. For a list of predefined resource types, see Resource Types.
lpName
[in] Pointer to a null-terminated string specifying the name of the resource to be updated. This parameter can also be an integer value passed to the MAKEINTRESOURCE macro.
wLanguage
[in] Specifies the language identifier of the resource to be updated. For a list of the primary language identifiers and sublanguage identifiers that make up a language identifier, see the macro.
lpData
[in]
Pointer to the resource data to be inserted into the executable file. If the resource is one of the predefined types, the data must be valid and properly aligned. Note that this is the raw binary data stored in the executable file, not the data provided by LoadIcon, LoadString, or other resource-specific load functions. All data containing strings or text must be in Unicode format; lpData must not point to ANSI data.
If lpData is NULL, the specified resource is deleted from the executable file.
cbData
[in] Specifies the size, in bytes, of the resource data at lpData.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
An application can use UpdateResource repeatedly to make changes to the resource data. Each call to UpdateResource contributes to an internal list of additions, deletions, and replacements but does not actually write the data to the executable file. The application must use the EndUpdateResource function to write the accumulated changes to the executable file.
--------------
The EndUpdateResource function ends a resource update in an executable file.
BOOL EndUpdateResource( HANDLE hUpdate,
BOOL fDiscard
);
Parameters
hUpdate
[in] Handle used in a resource update. This handle is returned by the BeginUpdateResource function.
fDiscard
[in] Specifies whether to write resource updates to an executable file. If this parameter is TRUE, no changes are made to the executable file. If it is FALSE, the changes are made.
Return Value
If the function succeeds and the accumulated resource modifications specified by calls to the UpdateResource function are written to the specified executable file, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Slicer
Здравствуйте, Slicer [Wirkwood], Вы писали:
[]
Windows 95/98/Me: Unsupported.
Здравствуйте, Patalog, Вы писали:
P>P>Windows 95/98/Me: Unsupported.
???? Это где ж такое ?
Function Information
Header: Declared in Winbase.h, include Windows.h
Import library: Kernel32.lib
Minimum operating systems: Included in Windows NT 3.1
А про семейство 95 никаких особых замечаний нет. Я про MSDN (offline).
Обычно это означает, что supported.
Slicer
Здравствуйте, Slicer [Wirkwood], Вы писали:
[]
SW>SW>Function Information
SW>Header: Declared in Winbase.h, include Windows.h
SW>Import library: Kernel32.lib
SW>Minimum operating systems: Included in Windows NT 3.1
Не настораживает?
PS Из MSDN July 2001. Впрочем MSDN .NET Combined Collection с ней согласна.
Здравствуйте, Slicer [Wirkwood], Вы писали:
S[>Здравствуйте, nap2k, Вы писали:
N>>Как можно редактировать рессурсы в ME и ниже?
S[>[q]
S[>The BeginUpdateResource function returns a handle that can be used by the UpdateResource
...
[msdn]
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Unsupported.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions.
See Also
Resources Overview, Resource Functions, BeginUpdateResource, EndUpdateResource, LoadIcon, LoadString, LockResource, MAKEINTRESOURCE, MAKELANGID, SizeofResource
Platform SDK Release: August 2001 What did you think of this topic?
Let us know. Order a Platform SDK CD Online
(U.S/Canada) (International)
[/msdn]
Здравствуйте, Блудов Павел, Вы писали:
...
БП>Одной из приятных особенностей этой библиотеки является
БП>реализация функций ::BeginUpdateResourceW(), ::UpdateResourceW()
БП>и ::EndUpdateResourceW(). Обратите внимание, что реализованы
БП>только уникодные версии. Но реализованы по настоящему.
Спасибо большое