GET ICON RESOURCE

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.0


GET ICON RESOURCE (resID; resData{; fileRef})

ParameterTypeDescription
resIDNumberIcon resource ID number
resDataPicturePicture field or variable to receive the picture
Contents of the cicn resource
fileRefNumberResource file reference number, or
all open resource files, if omitted

Description

The GET ICON RESOURCE command returns, in the picture field or variable resData, the icon stored in the color icon ("cicn") resource whose ID is passed in resID.

If the resource is not found, the resData parameter is left unchanged and the OK variable is set to 0 (zero).

If you pass a valid resource file reference number in resFile, the resource is searched for in that file only. If you do not pass resFile, the first occurrence of the resource found in the resource files chain is returned.

Example

The following example loads, in a Picture array, the color icons located in the active 4D application:

   If (On Windows)
      $vh4DResFile:=Open resource file(Replace string(Application file;".EXE";".RSR"))
   Else
      $vh4DResFile:=Open resource file(Application file)
   End if
   RESOURCE LIST("cicn";$alResID;$asResName;$vh4DResFile)
   $vlNbIcons:=Size of array($alResID)
   ARRAY PICTURE(ag4DIcon;$vlNbIcons)
   For ($vlElem;1;$vlNbIcons)
      GET ICON RESOURCE($alResID{$vlElem};ag4DIcon{$vlElem};$vh4DResFile)
   End for 

After this code has been executed, the array looks like this when displayed in a form:

See Also

GET PICTURE RESOURCE.

System Variables and Sets

If the resource is found, OK is set to 1. Otherwise, it is set to 0 (zero).


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next