网站首页  词典首页

请输入您要查询的函数:

 

术语 updateresource
释义 UpdateResource
语法:
BOOL UpdateResource( HANDLE hUpdate,
LPCTSTR lpType,
LPCTSTR lpName,
WORD wLanguage,
LPVOID lpData,
DWORD cbData
);
UpdateResource功能
添加,删除或替换在移植可执行(PE资源)的文件。有一些关于档案资源更新的限制,包括资源配置(区局配置)数据:语言中立(LN)的文件和语言特定的资源(。MUI)的文件。
参数
hUpdate
[中]模块句柄返回的BeginUpdateResource功能,引用该文件被更新。
lpType
[in]指向一个空结束的字符串指定资源的类型进行更新。或者,而不是一个指针,这个参数可以MAKEINTRESOURCE(身份证),其中ID是一个整数值,代表一个预定义的资源类型。对于预定义资源类型列表,请参阅资源类型。
lpName
[in]指向一个空结束的字符串指定资源的名称进行更新。或者,而不是一个指针,这个参数可以MAKEINTRESOURCE(身份证),其中ID是一个资源ID。当创建一个新的资源不使用一个字符串,以'#'此参数字符开始。
wLanguage
[in]指定的资源语言标识进行更新。如需主要语言标识符和子语言标识符列表组成一个语言识别,请参阅MAKELANGID宏。
lpData
[in]指向资源数据被插入到档案hUpdate表示。如果资源是预定义的类型之一,数据必须是有效和适当对齐。请注意,这是原始二进制数据被存储在文件中指出的hUpdate,而不是LoadIcon,LoadString,或其他资源提供的数据,特定的负载功能。包含字符串的所有数据或文本必须是Unicode格式。 lpData不能指向ANSI数据。
如果lpData为NULL和cbData为0,则指定的资源是从文件中删除了hUpdate表示。
cbData
[in]指定的大小,以字节为单位,在lpData的资源数据。
返回值
返回TRUE,如果成功,否则返回FALSE。为了获得更多错误信息,调用GetLastError。
备注
我们建议该资源文件未加载之前调用此函数。但是,如果该文件已经加载,它不会导致错误将返回。
应用程序可以反复使用UpdateResource作出资源数据的变化。每个UpdateResource呼吁促进了添加,删除内部列表和更换,但实际上并没有将数据写入到文件的hUpdate表示。应用程序必须使用EndUpdateResource函数写入累计对文件的更改。
此功能模块内可更新资源,同时包含代码和资源。
在此之前的Windows 7:如果lpData为NULL和cbData不为零,则指定的资源不被删除,并抛出异常。
在Windows 95/98/Me:UpdateResourceW是支持的Unicode(MSLU)微软层。要使用此,您必须将某些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
Windows Vista或更高版本:如上所述,有关于档案资源更新的限制,包含钢筋配置数据:法律公告文件和。MUI文件。的限制如下:
ActionLN file.mui文件
1。添加新的类型,在不存在或法律公告。梅在法律公告files.Add类型的文件,并当作语言无关的(非本地化),并添加新的类型或配置的RC只允许dataThe是增加项目以下类型:文件格式,钢筋配置数据,侧并排大会XML清单。
2。添加新的资源项目,以现有的type.Uses区域市政局配置数据,检查是否键入。妹存在的文件与此文件关联的法律公告。如果类型不存在。MUI文件,添加的项目,并作为联合国处理新项目本地化。如果类型中存在。MUI文件,然后加上是以下类型的不allowed.Only项目可能会被添加:文件版本,钢筋配置数据,侧并排大会XML清单。
3。更新资源item.Uses区域市政局配置数据,检查是否键入。妹存在文件与法律公告文件关联。如果类型不存在。MUI文件,那么这种资源项目的更新是在法律公告文件允许的。否则,如果键入。妹存在的文件,与此相关的法律公告文件,则此更新是allowed.The只允许更新以下类型的项目:由方大会的XML清单文件版本,钢筋配置数据,侧。
4。添加一个类型/新language.Not allowed.Not项目不允许的。
5。删除现有类型/ item.Works同样的情况3。使用遥控配置数据,以检查是否键入。妹存在文件与法律公告文件关联。如果没有,那么该类型的删除/从法律公告文件项目是允许的。否则,如果键入/项目的。妹存在的文件,与此相关的法律公告文件,然后删除不allowed.The只允许被删除类型有:文件格式,钢筋配置数据,侧并排大会XML清单,也只有这些类型的项目可能会被删除。
6。添加/删除/更新类型不包括在钢筋混凝土配置数据(如版本,侧并排大会XML清单,或RC配置数据本身)。 Allowed.Allowed。
7。其他更新的非本地化数据,如类型库,reginst等on.Update类型或法律公告文件项目,视为非本地化,添加新的类型或钢筋混凝土配置data.Not适用项目。
8。添加遥控配置data.Can做而是钢筋配置数据的完整性不会checked.Can做而是钢筋配置数据的完整性不会检查。
例如
有关示例,请参见更新资源。
功能信息
最低DLL版本 kernel32.dll
在Winbase.h HeaderDeclared,头文件:winuser.h
import libraryKernel32.lib
最低经营systemsWindows新台币3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
资源概况,BeginUpdateResource,EndUpdateResource,LoadIcon,LoadString,LockResource,MAKEINTRESOURCE,MAKELANGID,SizeofResource
==英文原文==UpdateResource Function
Adds, deletes, or replaces a resource in a portable executable (PE) file. There are some restrictions on resource updates in files that contain Resource Configuration (RC Config) data: language-neutral (LN) files and language-specific resource (.mui) files.
Syntax
BOOL UpdateResource( HANDLE hUpdate,
LPCTSTR lpType,
LPCTSTR lpName,
WORD wLanguage,
LPVOID lpData,
DWORD cbData
);
Parameters
hUpdate
[in] A module handle returned by the BeginUpdateResource function, referencing the file to be updated.
lpType
[in] Pointer to a null-terminated string specifying the resource type to be updated. Alternatively, rather than a pointer, this parameter can be MAKEINTRESOURCE (ID), where ID is an integer value representing 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. Alternatively, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is a resource ID. When creating a new resource do not use a string that begins with a '#' character for this parameter.
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 MAKELANGID macro.
lpData
[in] Pointer to the resource data to be inserted into the file indicated by hUpdate. 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 to be stored in the file indicated by hUpdate, 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 and cbData is 0, the specified resource is deleted from the file indicated by hUpdate.
cbData
[in] Specifies the size, in bytes, of the resource data at lpData.
Return Value
Returns TRUE if successful or FALSE otherwise. To get extended error information, call GetLastError .
Remarks
It is recommended that the resource file is not loaded before this function is called. However, if that file is already loaded, it will not cause an error to be returned.
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 file indicated by hUpdate. The application must use the EndUpdateResource function to write the accumulated changes to the file.
This function can update resources within modules that contain both code and resources.
Prior to Windows 7: If lpData is NULL and cbData is non-zero, the specified resource is NOT deleted and an exception is thrown.
Windows 95/98/Me: UpdateResourceW is supported by the Microsoft Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .
Windows Vista or later: As noted above, there are restrictions on resource updates in files that contain RC Config data: LN files and .mui files. The restrictions are as follows:
ActionLN file.mui file
1. Add a new type that doesn't exist in the LN or .mui files.Add type in the LN file and treat as language-neutral (non-localizable) and add new type or item in the RC Config dataThe only additions allowed are the following types: file Version, RC Config data, Side-by-side Assembly XML Manifest.
2. Add a new resource item to an existing type.Uses the RC Config data to check whether the type exists in the .mui files associated with this LN file. If the type doesn't exist in the .mui files, add the item and treat new item as un-localizable. If the type exists in the .mui files, then adding is not allowed.Only items of the following types may be added: File Version, RC Config data, Side-by-side Assembly XML Manifest.
3. Update a resource item.Uses the RC Config data to check whether the type exists in the .mui files associated with the LN file. If the type doesn't exist in the .mui files, then this resource item update is allowed in the LN file. Otherwise, if the type exists in the .mui files associated with this LN file, then this update is not allowed.The only updates allowed are items of the following types: file Version, RC Config data, Side-by-side Assembly XML Manifest.
4. Add a type/item for a new language.Not allowed.Not allowed.
5. Remove an existing type/item.Works similarly to case 3. Uses the RC Config data to check whether the type exists in the .mui files associated with the LN file. If not, then the removal of the type/item from the LN file is allowed. Otherwise, if the type/item exists in the .mui files associated with this LN file, then the removal is not allowed.The only types allowed to be removed are: file Version, RC Config data, Side-by-side Assembly XML Manifest; also, only items of these types may be removed.
6. Add/delete/update a type not included in the RC Config data (such as Version, Side-by-side Assembly XML Manifest, or RC Config data itself). Allowed.Allowed.
7. Other update of non-localizable data, such as TYPELIB, reginst, and so on.Update type or item in the LN file, treat as non-localizable, and add new type or item in the RC Config data.Not applicable.
8. Add RC Config data.Can be done but the integrity of the RC Config data is not checked.Can be done but the integrity of the RC Config data is not checked.
Example
For an example, see Updating Resources .
Function Information
Minimum DLL Versionkernel32.dll
HeaderDeclared in Winbase.h, include Windows.h
Import libraryKernel32.lib
Minimum operating systemsWindows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
Resources Overview , BeginUpdateResource , EndUpdateResource , LoadIcon , LoadString , LockResource , MAKEINTRESOURCE , MAKELANGID , SizeofResource
==原始网址==http://msdn.microsoft.com/en-us/library/ms648049(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:26:39