Commits or discards changes made prior to a call to UpdateResource.
Syntax
BOOL EndUpdateResource(
HANDLE hUpdate,
BOOL fDiscard
);
Parameters
- hUpdate
-
[in] A module handle returned by the BeginUpdateResource function, and used by UpdateResource, referencing the file to be updated.
- fDiscard
-
[in] Specifies whether to write the resource updates to the file. If this parameter is TRUE, no changes are made. If it is FALSE, the changes are made: the resource updates will take effect.
Return Value
Returns TRUE if the function succeeds; FALSE otherwise. If the function succeeds and
fDiscard is TRUE, then no resource updates are made to the file; otherwise all
successful resource updates are made to the file. To get extended error information, call GetLastError.
Remarks
Before you call this function, make sure all file handles other than the one returned by BeginUpdateResource are closed.
Windows 95/98/Me: EndUpdateResourceW 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.
This function can update resources within modules that contain both code and resources. There are restrictions on resource updates in LN files and .mui files, both of which contain Resource Configuration data; details of the restrictions are in the reference for the UpdateResource function.
Example
For an example, see Updating Resources.
Function Information
| Minimum DLL Version | kernel32.dll |
|---|
| Header | Declared in Winbase.h, include Windows.h |
|---|
| Import library | Kernel32.lib |
|---|
| Minimum operating systems |
Windows NT 3.1 |
|---|
| Unicode | Implemented as
ANSI and Unicode versions. |
|---|
See Also