请教程序终止问题

请教程序终止问题 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiBase/html/delphi_20061204224249292.html
1.新建一个   application   主窗口Form1  
  2.主窗口中放置一个Button,点击该Button,Form1.free,同时显示另外一个窗口Form2  
  3.关闭Form2,程序进程仍然在运行  
   
  我想问的时,怎么样才能关闭Form2的时候,将整个application进程终止。  
  谢谢

//form2.onclose  
  application.terminate;

posted on 2009-04-22 10:52  delphi2007  阅读(352)  评论(0编辑  收藏  举报