Module Registry.pkg

     1//  Registry Access Package
     2//  2/17/96 by Michael Gouker
     3//
     4//  This package defines commands to access the registry.
     5// 09/07/01 SWB Common symbols moved to RegistryAPI.pkg, to share with cRegistry.pkg
     6
     7// All of these are now obosolete techniques. Use cRegistry.pkg (also note that
     8// that the Windows_registry class no longer lives here. It has it's own package.
     9
    10Use RegistryAPI.pkg
    11
    12// This command retrieves the tree root of the registry and the default key path.
    13
    14#COMMAND GET_REGISTRY_ROOT "TO" _RUCE _RUCE .
    15  !A [] $554 !2 !3
    16#ENDCOMMAND
    17
    18// This command sets the tree root of the registry and the default key path.
    19
    20#COMMAND SET_REGISTRY_ROOT "TO" _RDUN _RDUN .
    21  !A [] $553 !2 !3
    22#ENDCOMMAND
    23
    24// This command retrieves the value associated with the application and
    25// tag passed.  If the tag is not found, then the return value will be
    26// a null string.  If the string is not found in the application, but
    27// it is found in the [DEFAULTS] section, this string will be returned.
    28//  Usage:  Get_Profile_String AppName TagName to ValueStr
    29
    30#COMMAND GET_PROFILE_STRING _RDUN _RDUN "TO" _RUCE .
    31  !A [] $546          // cleans up
    32  !A [] $542 !1 !2
    33  !A [] $543 !4
    34#ENDCOMMAND
    35
    36#COMMAND SET_PROFILE_STRING _RDUN _RDUN _RDN _G _G .
    37  #IF (!0 = 5)
    38    SET_FOREIGN_PROFILE_STRING !1 !2 !3 !4 !5
    39  #ELSE
    40    #IF (!0 = 4)
    41      #IFSAME !3 TO
    42        SET_FOREIGN_PROFILE_STRING "" !1 !2 !3 !4
    43      #ELSE
    44        SET_FOREIGN_PROFILE_STRING !1 !2 !3 TO !4
    45      #ENDIF
    46    #ELSE
    47      #IF (!0 = 3)
    48        SET_FOREIGN_PROFILE_STRING "" !1 !2 TO !3
    49      #ENDIF
    50    #ENDIF
    51  #ENDIF
    52#ENDCOMMAND
    53
    54#COMMAND GET_FOREIGN_PROFILE_STRING _RDUN _RDUN _RDUN "TO" _RUCE .
    55  !A [] $544 !1 !2    // sets filename and app name
    56  !A [] $542 !2 !3    // sets appname and tag
    57  !A [] $543 !5       // stores return value
    58  !A [] $546          // cleans up
    59#ENDCOMMAND
    60
    61#COMMAND SET_FOREIGN_PROFILE_STRING _RDUN _RDUN _RU "TO" _RU .
    62  !A [] $544 !1 !2
    63  SET_PROFILE_APP_INFO !3 !5 !6 !7 !8 !9
    64  !A [] $546
    65#ENDCOMMAND
    66
    67#COMMAND SET_PROFILE_APP_INFO _RU _RU
    68  #IF !0>0
    69    !A [] $545 !1 !2
    70    #IF !0>2
    71      SET_PROFILE_APP_INFO !3 !4 !5 !6 !7 !8 !9
    72    #ENDIF
    73  #ENDIF
    74#ENDCOMMAND
    75
    76#COMMAND SET_PROFILE_INT_APP_INFO _RU _RU
    77  #IF !0>0
    78    !A [] $55B !1 !2
    79    #IF !0>2
    80      SET_PROFILE_INT_APP_INFO !3 !4 !5 !6 !7 !8 !9
    81    #ENDIF
    82  #ENDIF
    83#ENDCOMMAND
    84
    85#COMMAND REG_GET_DWORD _RDUN _RDUN _RDUN _RDU "TO" _RUCE .
    86
    87  !A [] $544 !1 !2    // sets filename and app name
    88  !A [] $542 !2 !3    // sets appname and tag
    89  !A [] $55A !4 !6    // sets default value and return value to store.
    90  !A [] $546          // cleans up
    91
    92#ENDCOMMAND
    93
    94#COMMAND REG_SET_DWORD _RDUN _RDUN _RDUN "TO" _RU .
    95  !A [] $544 !1 !2    // sets filename and app name
    96  !A [] $542 !2 !3    // sets appname and tag
    97  !A [] $55B !5       // sets value.
    98  !A [] $546          // cleans up.
    99#ENDCOMMAND
   100
   101#COMMAND REG_ENUM_KEY_INFO _RDUN
   102// parameter 1 = callback object
   103  !A [] $55C !1
   104#ENDCOMMAND
   105
   106// Mike-S modification for recursion flag
   107#COMMAND REG_ENUM_KEY _RDUN _RDUN
   108  !A [] $55E !1 !2 // hKey, bRecurse - where to start enumerating.
   109#ENDCOMMAND
   110
   111
   112#COMMAND REG_ENUM_VALUE _RDUN
   113  !A [] $55F !1 // hKey
   114#ENDCOMMAND
   115
   116#COMMAND REG_CREATE_KEY _RDUN TO _RDUN
   117  !A [] $560 !1 !3 // string fully qualified, return hKey
   118#ENDCOMMAND
   119
   120#COMMAND REG_OPEN_KEY _RDUN TO _RDUN
   121  !A [] $561 !1 !3 // string fully qualified, return hKey
   122#ENDCOMMAND
   123
   124#COMMAND REG_CLOSE_KEY _RDUN
   125  !A [] $562 !1 // hKey to close.
   126#ENDCOMMAND
   127
   128#COMMAND REG_SET_ACCESS_RIGHTS TO _RDUN
   129  !A [] $57a !2 // Rights set.
   130#ENDCOMMAND
   131
   132#COMMAND REG_GET_ACCESS_RIGHTS TO _RDUN
   133  !A [] $57b !2 // Access rights to registry.
   134#ENDCOMMAND
   135
   136
   137//************************************************************************
   138//  Description:
   139//      Enumerate keys (one level) for a given tag under HKEY_LOCAL_MACHINE
   140//
   141//      The function, EnumRegistryKey, takes a Tag (eg SOFTWARE\DFWIN40) and
   142//      'returns' all sub-keys. This is achieved by passing the function a
   143//      call-back procedure-id. The call-back will take one parameter, a string,
   144//      that is the name of the sub-key.
   145//
   146//      The return value is the number of sub-keys enumerated.
   147//
   148//  Author: Stuart W. Booth
   149//************************************************************************
   150
   151
   152#REPLACE REG_VALUE_NOT_EXIST -10101
   153
   154
   155External_Function RegDeleteKey "RegDeleteKeyA" AdvApi32.dll ;
   156    Handle hParentKey String sSubKeyToDeleteName Returns Dword
   157
   158// as of 12.0, the windows_registy object, which is obsolete, has been moved to its
   159// own package. If you are using this, you now need to explicitly use it.
   160