* :--------------------------------------- * ------------------------: Copybook for Registry functions * : * : See the documentation for details. * :--------------------------------------- * ****************************************************************** ****************************************************************** ** All new applications should use the extended (FUNC-EX-) ** ** functions because they have more capability. ** ** ** ** The extended functions allow you to (optionally) supply the ** ** complete high-order node of a registry key, which allows ** ** you to read or write data anywhere in the Registry. ** ** ** ** The extended functions also allow you to select whether you ** ** access the registry on the SERVER or on the CLIENT. ** ****************************************************************** ****************************************************************** * * Client/Server Notes: * * These registry functions only access the SERVER's registry. * ---------------------------------------------------------------- * * FUNC-REGISTRY-PUT----------- Write/update data in the Registry * If key exists, * UPDATE the entry * else * CREATE the entry. * * FUNC-REGISTRY-GET----------- Get a value from the Registry * * FUNC-REGISTRY-DELETE-VALUE-- Delete a value from the Registry * * FUNC-REGISTRY-DELETE-SUBKEY- Delete a key and all descendants, * including all subkeys and values * ---------------------------------------------------------------- * * GUI ScreenIO will automatically store your application data in * the correct location in the Registry, complying with Microsoft * Windows standards. The high-order node of the registry key * uses the Company and Application values supplied in your MAIN * panel. * * The complete registry key generated by GUI ScreenIO is: * * HKEY_CURRENT_USER\Software\Company\Application\Subkey * * Your data is stored beneath your key in name/data pairs. You * may have many VALUENAME=DATA pairs stored beneath a single key. * * Note: 1. You must provide the company name and the name of your * application when you open your main/container panel. * * 2. The Subkey value must be LESS THAN 255 bytes, * ---------------------------------------------------------------- * * The functions are all similar. Here's how to save a value: * * COPY WIN32API. * COPY REGISTRY. * . * . * ------------------------: Specify the subkey value. * * MOVE 'My Settings' TO REGISTRY-SUBKEY. * * ------------------------: Specify whether TEXT or BINARY data. * * SET REGISTRY-DATA-IS-TEXT TO TRUE. * * ------------------------: Specify the value name and associated * : data to be stored. * * MOVE 'Value 1' TO REGISTRY-VALUENAME. * MOVE 'Registry Text Data' TO REGISTRY-DATA. * * ------------------------: Call the API to update the registry. * * SET FUNC-REGISTRY-PUT TO TRUE. * CALL 'GSWINAPI' USING WIN32API-PARMS * REGISTRY-PARMS * WIN32API-B * WIN32API-C * WIN32API-D * WIN32API-E * WIN32API-F. * * ------------------------: If function failed, * : display a textual error message. * * IF WIN32API-FAILED * MOVE WIN32API-ERROR-TEXT TO my-error-message * do whatever to display my-error-message. * * ---------------------------------------------------------------- * 01 REGISTRY-PARMS. * : Subkey. * 05 REGISTRY-SUBKEY PIC X(254). * : Your name for this data element. You * : can store multiple data items under * : the same registry subkey. 05 REGISTRY-VALUENAME PIC X(32). * : Data associated with your key. * : * : Function | Use * : -------- --------------------------- * : PUT Value to store/update * : GET Value retrieved * : DELETE Not used 05 REGISTRY-DATA PIC X(1023). * : Format of data. * : * : Function | Use * : -------- --------------------------- * : PUT Format of data to write * : GET Format of data retrieved * : DELETE Not used 05 REGISTRY-DATA-FORMAT PIC X. * : Text data up to 1023 bytes. 080825ja 88 REGISTRY-DATA-IS-TEXT VALUES LOW-VALUE '1'. 080825ja * : Binary data (any form) up to 1023 byts080825ja 88 REGISTRY-DATA-IS-BINARY VALUES 'B' '3'. 080825ja * : Strings which may contain unexpanded 080825ja * : environmental values 080825ja * : such as %path%myprog.exe 080825ja 88 REGISTRY-DATA-IS-EXPAND-SZ VALUES '2'. 080825ja * : A Sequence of null terminated strings 080825ja * : terminated by two consecutive nulls. 080825ja * : Usefull for packing multiple variables080825ja * : into a single registry variable. 080825ja 88 REGISTRY-DATA-IS-MULTI-SZ VALUES '7'. 080825ja * : Dword = S9(9) comp-5. 4 Bytes 080825ja 88 REGISTRY-DATA-IS-DWORD VALUES '4'. 080825ja * : Qword = S(9)v9(9) comp-5. 8 Bytes. 080825ja 88 REGISTRY-DATA-IS-QWORD VALUES '8'. 080825ja 080825ja * : Byte count. * : - Not used for TEXT * : - Required for BINARY data. * : * : Function | Use * : -------- --------------------------- * : PUT Number of bytes in DATA * : GET Bytes returned * : DELETE Not used 05 REGISTRY-DATA-LENGTH PIC S9(9) COMP-5.