Autor Beitrag
M.Mü
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68



BeitragVerfasst: Do 19.10.06 23:51 
Hallo,

habe ein Programm welches MDI Childs nutzt (öffnen, schließen, ...). Beim schließen der Childs sollen bestimmte Werte gesetzt werden. Allerdings darf dies nicht geschehen, wenn das gesamte Programm geschlossen wird.

Wie kann ich dies unterscheiden? ... ob nur das einzelne Child oder das geamte Programm geschlossen wird? Habe es schon mit einer Boolvariable versucht, die bei MainForm.Close gesetzt wird. Nur geht dies nicht, weil erst die Childs geschlossen und dann Onclose des MainForm ausgeführt wird.

Hat jemand ne Idee?

VG M.Mü
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Do 19.10.06 23:54 
Mainform.OnCanClose dürfte vor den Closes der Clients kommen. Sicher bin ich aber nicht. Probiers mal aus!

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
M.Mü Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68



BeitragVerfasst: Do 19.10.06 23:59 
OnCanClose gibts bei TForm nicht, ich denk mal Du meinst OnCloseQuery. Das kommt leider auch erst danach :-(
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 20.10.06 02:10 
Wie wärs mit WM_Close? Wenn du das (enweder per message procedure oder per WndProc) abfängst, muss das vorher kommen, denn diese Botschaft veranlasst das Programm ja zum Schließen.
M.Mü Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68



BeitragVerfasst: Fr 20.10.06 07:24 
Wart mal, dass das OnCloseQuery voher kommt klingt unlogisch. Ich glaub es war gestern einfach nur zu spät und hab irgendwas falsch gemacht. Ich werds heut Abend nochmal probieren.
M.Mü Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68



BeitragVerfasst: Fr 20.10.06 22:46 
Das Problem hat sich gelöst ... hatte dummerweise stets beim CloseQuery der Childs geschaut. Dieses Ereignis wird logischerweise vor dem OnClose des MainForm ausgelöst. :roll: peinlich peinlich

Ansonsten passt alles ... erst OnClose des MainForm dann das OnClose der Childs

VG M.Mü