Autor Beitrag
cux
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Mo 27.12.04 14:35 
Kann man irgendwie darauf reagieren, wenn eine Form mimnimiert wird?
Oder vielleicht ausschalten, dass sie minimiert werden kann?

cux
Spatz
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

WIN 2k
D7E
BeitragVerfasst: Mo 27.12.04 14:38 
eine eigente onMinimize- Methode schreiben und dann
ausblenden Delphi-Quelltext
1:
Application.onMinimize := meineOnMinimizeMethode;					
cux Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Mo 27.12.04 14:40 
wie schreibt man denn eine eigene methode?
Spatz
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

WIN 2k
D7E
BeitragVerfasst: Mo 27.12.04 14:50 
hmmmm...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
type Form1 = class(TForm)
  procedure FormCreate(Sender: TObject);
private 
  procedure onMinimize(Sender: TObject);

//...

procedure Form1.FormCreate(Sender: TObject);
begin
  Application.onMinimize := onMinimize;
end;

procedure Form1.onMinimize(Sender: TObject);
begin
  Application.Minimize;
end;
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Mo 27.12.04 15:06 
cux hat folgendes geschrieben:
Kann man irgendwie darauf reagieren, wenn eine Form mimnimiert wird?
Oder vielleicht ausschalten, dass sie minimiert werden kann?

Du kannst z.B. den Minimieren-Button deaktivieren.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.FormCreate(Sender: TObject);
begin
  Self.BorderIcons := Self.BorderIcons - [biMinimize];
  DeleteMenu(GetSystemMenu(Application.Handle, False), SC_MINIMIZE, MF_BYCOMMAND);
end;


Oder halt die Windows Nachricht SC_MINIMIZE abfangen und nicht weiterleiten.

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
type
  TForm1 = class(TForm)
  ...
  private
    { Private-Deklarationen }
    procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;
    procedure OnAppMessage(var Msg: TMsg; var Handled: Boolean);
  ...
  end;

  ...

{--------------------------------------------------------------------------------------------------}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.OnMessage := OnAppMessage;
end;

{--------------------------------------------------------------------------------------------------}

procedure TForm1.OnAppMessage(var Msg: TMsg; var Handled: Boolean);
begin

  if (Msg.message = WM_SYSCOMMAND) and (Msg.wParam = SC_MINIMIZE) then
    Handled := True
  else
    Handled := False;

end;

{--------------------------------------------------------------------------------------------------}

procedure TForm1.WMSysCommand(var Message: TWMSysCommand);
begin

  if Message.CmdType <> SC_MINIMIZE then
    inherited;

end;

{--------------------------------------------------------------------------------------------------}

...

_________________
Ciao, Sprint.