Board index » delphi » Windows exit terminates delphi app rudely
GGHG...@prodigy.com (Samuel Washburn)
![]() Delphi Developer |
Fri, 06 Mar 1998 03:00:00 GMT
|
GGHG...@prodigy.com (Samuel Washburn)
![]() Delphi Developer |
Fri, 06 Mar 1998 03:00:00 GMT
Windows exit terminates delphi app rudely
If a user is running my delphi APP and exits windows without first
exiting the Delphi app, the app just gets vaporized. Its an abnormal exit, files are left in funny states etc. I would like it to behave as if the user double clicked the upper left hyphen bar in the APP's window. Does anyone know how to: 2. or barring that, set a flag that prevents windows from exiting if my Thanks |
shauna bolingbro
![]() Delphi Developer |
Fri, 06 Mar 1998 03:00:00 GMT
Re:Windows exit terminates delphi app rudelyQuoteSamuel Washburn (GGHG...@prodigy.com) wrote: OnClose Check the online help. You can cancel the action if you need to save Quote> 2. or barring that, set a flag that prevents windows from exiting if my Ken Bolingbroke |
Samuel Washbu
![]() Delphi Developer |
Sat, 07 Mar 1998 03:00:00 GMT
Re:Windows exit terminates delphi app rudelyThanks. Your suggestions work but there are some subtleties here that are worth knowing about: Onclosequery and Onclose events fire in that order if you do any of the However if you just exit from windows with out doing any of the above, |
Hallvard Vassbo
![]() Delphi Developer |
Sat, 07 Mar 1998 03:00:00 GMT
Re:Windows exit terminates delphi app rudelyIn <43kvg4$...@dewey.csun.edu> hbdef...@huey.csun.edu (shauna bolingbroke) writes: Quote>Samuel Washburn (GGHG...@prodigy.com) wrote: A solution to this problem is to handle the WM_EndSession message from Windows by calling Halt. This will call all exitprocs, cleaning things up after BDE etc. Use Application.HookMainWindow to handle the WM_EndSession message. An example of how to do this will (probably) surface in the next issue of The Delphi Magazine (contact the editor Chris Frizielle at 70630....@compuserve.com). -- |
Hallvard Vassbo
![]() Delphi Developer |
Sun, 08 Mar 1998 03:00:00 GMT
Re:Windows exit terminates delphi app rudelyIn <43mjia$...@usenetp1.news.prodigy.com> GGHG...@prodigy.com (Samuel Washburn) writes: Quote>Thanks. Your suggestions work but there are some subtleties here that are allow Windows to close down, your program will close down when it should not. As said before, you can solve this bug by doing this: procedure TForm1.FormCreate(Sender: TObject); procedure TForm1.FormDestroy(Sender: TObject); function TForm1.HookProc(var Message: TMessage): boolean; When Windows is actualy closing down, it sends a WM_EndSession message. The cleanest solution would have been to call Application.Terminate So my solution is to simply call Halt. This might seem drastic, but it This solution will _not_ call your OnClose handler, but it _will_ call your -- |
1. HOW TO BYPASS WINDOWS EXIT FROM APP ?
2. Windows NT terminates DB-App on process?
3. Windows exit prior to program exit
4. Executing SQL Query Terminates Delphi and App.!!
5. Q:Terminate DOS app within Delphi
6. Terminating another application from a Delphi App
7. External Exception when app exits within Delphi under NT4.0
8. .Delphi App hangs on exit on all PC's except developer's