How to minimize application with modal window
When you minimize modal window, this window is “hidden” behind (or below) application main form. Using this simple trick, we can minimize also the main application window together with modal “child” window.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
. . . private procedure WMSyscommand(var Msg: TWmSysCommand); message WM_SYSCOMMAND; . . . procedure TForm1.WMSysCommand(var Msg: TWmSysCommand); begin case (Msg.CmdType and $FFF0) of SC_MINIMIZE: begin Msg.Result := 0; EnableWindow(Application.Handle, True); Aplication.Minimize; end; else inherited; end; end; |