Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.6l

Application v 6.6b

  

 

Chapter Fifteen — Windows/OS Functions (continued)

ReplaceModuleResource Function

Overview

The ReplaceModuleResource function finds a specific resource and replaces it with a new resource.

Syntax/Parameters

Syntax

int = ReplaceModuleResource ( string target, int type, string name, handle | string data );

Parameters

target

A string specifying the filename and path for a target module. The module must be an exe or dll file.

type

An int specifying the resource type.

name

A string specifying the name of the resource.

data

A handle or string specifying the source data. If a handle is specified, it must be a Data Object containing the binary data to use as the new resource item. If a string is specified, it must be a filename and path to a file containing the binary data to use as the new resource item.

Return Value

Returns an int as ERROR_NONE or a formatted error code on failure.

Remarks

Information specified by the data parameter must match the resource type. Note that internally, resource icon data is broken into individual images of varying resolution. Use the ReplaceModuleIcon function to replace all the icons under a specified name.

The types are as follows:

  Definition   Code   Description  
  RT_CURSOR   1   Hardware-dependent cursor resource (a single cursor image).  
  RT_BITMAP   2   Bitmap resource.  
  RT_ICON   3   Hardware-dependent icon resource (a single icon image).  
  RT_MENU   4   Menu resource.  
  RT_DIALOG   5   Dialog box template.  
  RT_STRING   6   String-table entry.  
  RT_FONTDIR   7   Font directory resource.  
  RT_FONT   8   Font resource.  
  RT_ACCELERATOR   9   Accelerator (keyboard shortcut) table.  
  RT_RCDATA   10   Application-defined resource (raw data).  
  RT_MESSAGETABLE   11   Message-table entry (used by FormatMessage).  
  RT_GROUP_CURSOR   12   Hardware-independent cursor resource (a group of RT_CURSOR images).  
  RT_GROUP_ICON   14   Hardware-independent icon resource (a group of RT_ICON images).  
  RT_VERSION   16   Version information resource (VERSIONINFO).  
  RT_DLGINCLUDE   17   Associates a string, typically a header file name, with an .rc file for resource editing tools; ignored by the resource compiler.  
  RT_PLUGPLAY   19   Plug and Play resource (obsolete).  
  RT_VXD   20   VxD (virtual device driver) resource (obsolete).  
  RT_ANICURSOR   21   Animated cursor.  
  RT_ANIICON   22   Animated icon.  
  RT_HTML   23   HTML resource.  
  RT_MANIFEST   24   Side-by-side assembly manifest  

The script mast have the appropriate rights to modify the target file. 

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic

Page revised 2026-11-16