JScript Resources

Log-in or register.

JScript Resources

Resources is an interface wrapper accessible as a property of the Document object and allows modification of resources in a PE (Portable Executable) file.

Methods and properties

  • ResourceIDs (get) - returns an array of resource identifiers.
  • object GetIDsByType(object type) - returns an array of resource identifiers of given type.
  • object CreateID(object type, object name, int lang) - returns a resource identifier from the 3 parts.
  • object GetIDsFromState(object context, string state) - returns an array of identifiers from the selected state in a Context object.
  • void PutIDsToState(object context, string state, object selectedItems) - replaces the state in the context object with the selectedItems object, which may be a single identifier or an array of identifiers.
  • object GetResource(object resID) - returns a sub-document object for the given identifier.
  • void DeleteResource(object resID) - deletes a resource.
  • object CreateResource(object type) - creates new resource of given type and return its identifier.
  • object TypeIcon (get) - constant of the Icon type.
  • void ChangeResourceID(object resID, object newName, int newLang) - change name and language of a resource. The method fails if resource with given IDs already exists.
  • string GetResourceName(object resID) - returns icon name (only works with ICL files).
  • void SetResourceName(object resID, string name) - changes icon name (only works with ICL files).

Resource identifier object

The above method use resource identifiers - objects with following methods:

  • object Type (get/set) - integral or string identifier of resource type.
  • object Name (get/set) - integral or string identifier of resource name.
  • int Lang (get/set) - language identifier.

Example

// add a new icon to icon library
var res = Document.Resources;
res.CreateResource(res.TypeIcon);

Recent comments

user icon Anonymous
What about ICL files?
I wish there were...