Board index » delphi » Application Close - And Data Lost - URGENT URGENT

Application Close - And Data Lost - URGENT URGENT

I wrote an Application, like Post If of 3M, and one of my clients told
me that he lost some notes.

On the next day i wentto his office and understand his problem:

Problem: when i close windows, how could i ensure that windows close my
program?
When i close windows, the task Form.Close dosen't run.

How could i solve this.

Sorry about my lausy english.

Thank's in advance

Marco Branco

 

Re:Application Close - And Data Lost - URGENT URGENT


Look for WMQueryEndSession in the win32.hlp file.

private
    { Private declarations }
    procedure WMQueryEndSession(var Message: TMessage); message
WM_QUERYENDSESSION;

procedure TForm1.WMQueryEndSession(var Message: TMessage);
begin
     MessageDlg('Windows is shutting down!',mtInformation,[mbOk],0);
     Message.Result := 1;
end;

HTH,
Scott

Marco Antonio Soares Branco wrote in message
<36F6CDE4.6...@student.ua.pt>...

Quote
>I wrote an Application, like Post If of 3M, and one of my clients
told
>me that he lost some notes.

>On the next day i wentto his office and understand his problem:

>Problem: when i close windows, how could i ensure that windows close
my
>program?
>When i close windows, the task Form.Close dosen't run.

>How could i solve this.

>Sorry about my lausy english.

>Thank's in advance

>Marco Branco

Re:Application Close - And Data Lost - URGENT URGENT


When windows closes it calls the function Form1.CloseQuery (or something
like that).
In this function you can e.g. save all the things you need to save before
the program shuts down...

I hope this could help ya,
    Gnther

Re:Application Close - And Data Lost - URGENT URGENT


In article <7d67kd$8r...@WS01IS04.highway.telekom.at>, "Stadler G."

Quote
<Stadl...@aon.at> writes:
>When windows closes it calls the function Form1.CloseQuery (or something
>like that).
>In this function you can e.g. save all the things you need to save before
>the program shuts down...

>I hope this could help ya,
>    Gnther

This doesn't allways apply. If you close the main form while other forms are
showing neither CloseQuery or Close fire, only Destroy fires for the child
forms.

tbmk

Gordon.

http://members.aol.com/mgcsoft/
http://members.aol.com/delphistuf/delphstf.htm   (bits and bobs and a few
links)

MGCSoft

Other Threads