FUNCTION

This attribute allows an application to include its own set of ARexx commands. You specify a pointer to an array of MUI_Command structures, which look like this:

   
   struct MUI_Command
   {
      char        *mc_Name;
      char        *mc_Template;
      LONG         mc_Parameters;
      struct Hook *mc_Hook;
      LONG         mc_Reserved[5];
   };

mc_Name
contains the name of your command. Commands are not case sensitive.

mc_Template
is an argument template that follows the same rules as dos.library/ReadArgs(). It may be NULL, in which case your command doesn't need any parameters.

mc_Parameters
is the number of parameters specified in the template array.

mc_Hook
is a pointer to the callback hook defining the function to be called.

You may specify any number of MUI_Command structures, but you must terminate your array with a NULL field.

When a command shows up an applications ARexx port, MUI parses the arguments according to the given template and calls the hook with the application object as hook object in a2 and a pointer to an array of longwords containing the parameters in a1.

The result code of your hook will be replied to ARexx as rc.

If you have some simple ARexx commands that just emulate some user action (e.g. clicking a button), you can use the magic cookie MC_TEMPLATE_ID for mc_Template and a return id value for mc_Parameters. In this case, MUI will do no argument parsing and instead simply return the specified id value on the next call to MUIM_Application_Input.

For more sophisticated possibilities in ARexx callback hooks, please refer to MUIA_Application_RexxMsg and MUIA_Application_RexxString.