Usually, for MDI programs, I tend to use Title Recognition rather than Class or FileName recognition.
With or without files opened in an MDI program, the title differs. So it is possible to assign different actions to different states for the program. For example, if a file is opened in EditPlus, its title looks like "EditPlus - [...]", without files opened, the title is "EditPlus". So, I assign Down-Right to "Ctrl+F4" if the title is "EditPlus - *", and the global actions (Down-Right = Alt+F4) will be used if all files in EditPlus are closed and the title is EditPlus, no longer matching the title pattern "EditPlus - *" when MDI windows are inside.
It is impossible to find out icons for title recognition.