Autor Beitrag
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Fr 27.10.06 14:45 
Hi,

Wie man das Minimieren des Hauptformulares einer Anwendung abfängt, ist ja einfach: Dazu gibt es die ApplicationEvents-Komponente.

Nur, wie bekomme ich raus, wenn jemand auf den Minimize-Button eines untergeordneten Fensters klickt?

_________________
Na denn, dann. Bis dann, denn.
alzaimar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Fr 27.10.06 16:37 
Einmal tief Luft holen und ordendlich recherchieren und fertig ist die Lösung:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
Type
  TMyForm = Class (TForm)
...
    Procedure CMSysCommand(Var Msg: TMessage); message WM_SYSCOMMAND;
  End;
...

Procedure TfmMainTemplate.CMSysCommand(Var Msg: TMessage);
Begin
  Case MsgwParam Of
    SC_RESTORE: 
        WindowState := wsNormal;
    SC_MINIMIZE: 
        Application.Minimize;
    SC_CLOSE:
      Close;
    SC_MAXIMIZE:
      WindowState := wsMaximized;
  End;
End;

_________________
Na denn, dann. Bis dann, denn.