4D v13.4

GET ICON RESOURCE

Home

 
4D v13.4
GET ICON RESOURCE

GET ICON RESOURCE 


 

GET ICON RESOURCE ( resID ; resData {; fileRef} ) 
Parameter Type   Description
resID  Longint in Icon resource ID number
resData  Picture in Picture field or variable to receive the picture
in Contents of the cicn resource
fileRef  DocRef in Resource file reference number, or all open resource files, if omitted

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:

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

 
PROPERTIES 

Product: 4D
Theme: Resources
Number: 517

The OK variable is changed by the command

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D v6

 
SEE ALSO 

GET PICTURE RESOURCE