線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1006
推到 Plurk!
推到 Facebook!

Application, Form Closing and Cleanup

 
dllee
站務副站長


發表:321
回覆:2519
積分:1711
註冊:2002-04-15

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-01-23 15:34:45 IP:61.231.xxx.xxx 未訂閱
今天再次上網找 COM port 元件... 雖然抓了很多... 不過還沒試出來... 但是卻有意外驚喜,與大家分享一下。 資料來源: http://www.mestdagh.biz/ http://users.pandora.be/sonal.nv/components.html    
Hints
Cleanup when closing
When an appliation is closed there is often need for some cleanup or savings of some work. Some events are fired when the application terminate, but it is depending on how the application is closed and often different in main form than in other forms. These are the called events: When closing the main form, the following main form events are called:
  • OnCloseQuery
  • OnClose
  • OnDestroy
For the other forms:
  • OnDestroy
When windows shutdown, all forms:
  • OnCloseQuery
When a WM_QUIT message is received, or calling Application.Terminate, all forms:
  • OnDestroy
This means you have to build some simple logic if you have to do savings / cleanup at the end of the application's lifetime. It can be the same in all forms:
  • In OnCloseQuery: Set a boolean and call the cleanup code
  • In OnDestroy: Check the boolean, and if not set then call the cleanup code
沒空更新的網頁... http://coolsite.to/dllee C及指標教學,計算機概論,資訊管理導論... http://coolsite.to/ushells 介紹Shells,LiteStep,GeoShell....
------
http://www.ViewMove.com
系統時間:2024-04-24 14:42:28
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!