4D v16.3

GET ICON RESOURCE

Home

 
4D v16.3
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

This command is not supported in 64-bit versions of 4D. It returns an error if it is executed in this environment.

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).



See also 

GET PICTURE RESOURCE

 
PROPERTIES 

Product: 4D
Theme: Resources
Number: 517

The OK variable is changed by the command

 
HISTORY 

Created: 4D v6

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)