Autor Beitrag
msickel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

WinXP Pro
Delphi 2 Pro, Delphi 4 Pro, Delphi 7 Pers, Delphi 2005 Pers, Delphi 2005 Pro
BeitragVerfasst: Fr 18.02.05 17:10 
Wenn man eine Form hat, hat man ja meistens auch den oberen Balken der Form, wenn man diesen mit einem doppelklick anklickt wird ja normalerweise das Fenster maximiert, und bei erneutem doppelklick wird wieder die ursprüngliche Größe hergestellt.

Wie kann man denn das abfangen und selbst darauf reagieren???


gruß Martin
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Fr 18.02.05 23:17 
So:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
type
 TForm1 = class(TForm)
// (...)
 private
   procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND;
 public
 end;

procedure TForm1.WMSysCommand(var Msg: TWMSysCommand); 
begin
 Case Msg.CmdType of
  SC_MINIMIZE: ...
  SC_MAXIMIZE: ...
  SC_RESTORE: ...
  SC_CLOSE: ...
 end;
 DefaultHandler(Msg);
end;

Gruss


Zuletzt bearbeitet von delfiphan am Sa 26.03.05 20:50, insgesamt 1-mal bearbeitet
msickel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

WinXP Pro
Delphi 2 Pro, Delphi 4 Pro, Delphi 7 Pers, Delphi 2005 Pers, Delphi 2005 Pro
BeitragVerfasst: Sa 19.02.05 17:32 
welche uses muss ich noch einbinden um die auftretenden Fehlermeldungen nicht zu erhalten?

Martin
Roosevelt
ontopic starontopic starofftopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 223

Win XP prof. SP2, Win XP Home SP2, Suse 9.2
Delphi 6 Personal, Delphi 2005
BeitragVerfasst: Sa 19.02.05 17:47 
wie lautet die fehlermeldung???

_________________
Glaube niemals das was du weißt!!!
msickel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

WinXP Pro
Delphi 2 Pro, Delphi 4 Pro, Delphi 7 Pers, Delphi 2005 Pers, Delphi 2005 Pro
BeitragVerfasst: Sa 19.02.05 18:06 
[Fehler] Main.pas(92): Unbekannte Anweisung: 'message'
[Fehler] Main.pas(113): Undefinierter Bezeichner: 'DefaultHandler'
[Fehler] Main.pas(54): Ungenügende Forward- oder External-Deklaration: 'TfrmAPod.WMSysCommand'


das sind die Fehlermeldungen die kommen!

Martin
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Sa 19.02.05 18:53 
ich glaube uses Messages :)

mfg matze

_________________
si tacuisses, philosophus mansisses.
msickel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

WinXP Pro
Delphi 2 Pro, Delphi 4 Pro, Delphi 7 Pers, Delphi 2005 Pers, Delphi 2005 Pro
BeitragVerfasst: Sa 19.02.05 20:50 
Messages hatte ich schon integriert, habe das Problem jetzt aber gelöst, jedoch werden hier nur die close minimize und maximize abgefangen, jedoch nicht das Ereignis wenn man auf den balken doppelklickt, oder gibts da auch eine message dafür!


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
type  
 TForm1 = class(TForm)  
// (...)  
 private  
   procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND;  
 public  
 end;  

 
procedure TForm1.WMSysCommand(var Msg: TWMSysCommand);  
begin  
 Case Msg.CmdType of  
  SC_MINIMIZE: ...  
  SC_MAXIMIZE: ...  
  SC_RESTORE: ...  
  SC_CLOSE: ...  
 end;  
 DefaultHandler(Msg);  
end;


so gehts ohne Fehler bei mir!
Martin
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Sa 19.02.05 21:54 
Ok das war ein Copy Paste Fehler, hast schon recht. ;)
Gruss