How to close dialogs open on main form - *from* the main form
Posted on 2005-04-26
I have searched EE and have not found a suitable solution. I have also googled with no luck yet.
When my application receives a certain wm_Timer message,
I want to close all the dialogs over the main form of my application
Important: There may be 2 levels of dialogs (e.g. dialog1 which has an opendialog showing).
The solution needs to be abstract, I will _not_ have variable names (fdialog1) nor classnames (tfdialog1) to use
I already have the wm_timer part
procedure WMTimer( var Msg : TMessage ); message wm_timer;
procedure TForm1.WMTimer(var Msg: TMessage);
if msg.wParam = 101 then
// close modal dialog boxes here