How "Multi" Actions Work
First, you assign the multi action to a menu item, like this:
- Code: Tout sélectionner
[Menu.Left]
Type: item; Caption: "Run Multiple Commands"; Action: multi; Actions: MultiActions
This tells AeTrayMenu to look in a section called [MultiActions] for the actions that have to be performed when the user chooses the menu item.
In such a batch actions section, you list the actions. It is like listing a menu, but without the Type, Caption and Glyph parameters. For example:
- Code: Tout sélectionner
[MultiActions]
Action: run; FileName: "%Windows%\Notepad.exe"
Action: run; FileName: "%Windows%\Calc.exe"
This example opens both Notepad and Calculator.
Preventing Simultaneous Execution
It is possible to suspend execution of the next action until the current item has completed. In the example above, AeTrayMenu tells Windows to run Notepad, and right after that issues the command to run Calculator. What if you want to run Notepad, and after Notepad has closed run Calculator?
For those situations, the actions run, shellexecute and service have the waituntilterminated flag. You could for example enter:
- Code: Tout sélectionner
[MultiActions]
Action: run; FileName: "%Windows%\Notepad.exe"; Flags: waituntilterminated
Action: run; FileName: "%Windows%\Calc.exe"
in the configuration file, so that Calculator will be run after Notepad has closed.
Another flag, waituntilinputidle, is supported only by run and shellexecute. It suspends execution of the batch actions until the program/document that is executed is ready for user input.