Please enable JavaScript to view this site.

A-Shell Reference

xcall MIAMEX, MX_REGISTRY, REGOP_OPEN, hkey, subkey, rights, hkeynew, status

This call is needed to open up a branch of the Registry and returns a handle which can be used in subsequent opcodes.

Parameters

hkey  (B,4)  [in]

can be a key returned in the hkeynew parameter from a previous open, or more likely, one of the following symbols (from ashell.def) for the main hives in the Registry:

Symbol

HKEY_CLASSES_ROOT

HKEY_CURRENT_USER

HKEY_LOCAL_MACHINE

HKEY_USERS

 

subkey  [in]

is a string combining one or more levels beneath the level referenced by the key hkey, for example:

SUBKEY = "SOFTWARE\MicroSabio\JBCT\ATE"

Note that subkey is not case sensitive on lookup, but when creating keys, the case specified will be retained. (Same idea as with Windows filenames.)

rights  [in]

is a numeric variable combining one or more of the following bits relating to the kind of rights you want to request for this key:

Symbol

Value

Description

RGKEY_QUERY_VALUE

&h00000001

Ability to query a value

RGKEY_SET_VALUE

&h00000002

Ability to change or set a value

RGKEY_CREATE_SUB_KEY

&h00000004

Ability to create a new sub key

RGKEY_ENUM_SUB_KEYS

&h00000008

Ability to enumerate sub keys

RGKEY_WOW64_32KEY

&h00000200

access key from 32 bit registry view

RGKEY_WOW64_64KEY

&h00000100

access key from 64 bit registry view

RGKEY_DELETE

&h00010000

ability to delete key

Definition file: ashell.def

Hex-Decimal Values

 

hkeynew  (B,4)  [out]

will return the handle to the opened key, and will be needed for subsequent operations. Note that in a non-Windows environment, since the operation will do nothing, it will not update the hkeynew parameter. You should therefore set it to zero initially, so that you can check to make sure that it comes back with a non-zero value.

status  (F6)  [out]

returns 0 for success, or else an error code. You can convert the error code to a message using: xcall MIAMEX, MX_ERRNOMSG, status, msg. Note that status may not be set in the case of the non-Windows environment; see hkeynew comments for error checking advice.