Chris_H
Expert Member
I need a way to close all modal forms on my MDI application. Closing all mdiChild forms is easy but I can't figure out how to close any/all open Modal forms? I know that the user is supposed to close the Modal forms but my software is privilage based and I want it to "lock" the interface after x minutes of inactivity.
Is there some way of getting a list of active modal forms like when using Form.MDIChildren? eg.:
for I := frmMain.MDIChildCount - 1 downto 0 do
Begin
frmMain.MDIChildren.Close;
End;
The only way I can think of doing it up to now is to use Window Messages but this means having to add code to every modal form where as I want to be able to do it from only the main form.
Is there some way of getting a list of active modal forms like when using Form.MDIChildren? eg.:
for I := frmMain.MDIChildCount - 1 downto 0 do
Begin
frmMain.MDIChildren.Close;
End;
The only way I can think of doing it up to now is to use Window Messages but this means having to add code to every modal form where as I want to be able to do it from only the main form.