struct ActlKeyMacro {
int Command;
union{
struct {
char *SequenceText;
DWORD Flags;
} PlainText;
DWORD Reserved[3];
} Param;
};
| Command | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| MCMD_LOADALL | Read all macros from the registry into FAR memory. Previous values are erased. | ||||||||||||
| MCMD_POSTMACROSTRING | Pass a macro in text form to FAR (in the same format as macros are stored in the registry). The AdvControl function returns TRUE if the macro is analyzed and placed into the queue (the macro will start running when FAR gets control). FALSE is returned if the macro contains any error. | ||||||||||||
| MCMD_SAVEALL | Forces FAR to immediately save all macros from memory to the registry. | ||||||||||||
| MCMD_GETSTATE | Get macro execution status. Returns one of the following values (enum FARMACROSTATE):
|
| Flag | Description |
|---|---|
| KSFLAGS_DISABLEOUTPUT | Disable screen output during macro playback. |
| KSFLAGS_NOSENDKEYSTOPLUGINS | Don't send keystrokes to editor plugins (plugins, that export ProcessEditorInput function). |
| KSFLAGS_REG_MULTI_SZ | The Param.PlainText.SequenceText parameter is represented in the REG_MULTI_SZ format. REG_MULTI_SZ in the registry: line 1\x00 line 2\x00 ... line N\x00 \x00 |
command.Command=MCMD_POSTMACROSTRING;
command.Param.PlainText.SequenceText=(char *)malloc(strlen(pCmd)+1);
if(command.Param.PlainText.SequenceText)
{
command.Param.PlainText.Flags=KSFLAGS_DISABLEOUTPUT;
strcpy(command.Param.PlainText.SequenceText,pCmd);
Info.AdvControl(Info.ModuleNumber,ACTL_KEYMACRO,&command);
free(command.Param.PlainText.SequenceText);
}
MCMD_LOADALL usage in FARCmds plugin:
command.Command=MCMD_LOADALL; Info.AdvControl(Info.ModuleNumber,ACTL_KEYMACRO,&command);MCMD_SAVEALL usage in FARCmds plugin:
command.Command=MCMD_SAVEALL; Info.AdvControl(Info.ModuleNumber,ACTL_KEYMACRO,&command);