如何实现可在程序启动、结束时自动以(100分)

  • 主题发起人 crazymoon
  • 开始时间
C

crazymoon

Unregistered / Unconfirmed
GUEST, unregistred user!
要编一个控件[有两个方法],当把它放到窗体上时不要写任何代码,

运行程序显示“程序开始启动;
关闭程序显示“程序关闭”

 
在哪儿显示?
 
还值当用控件吗?
 
判断程序是否是active?
其实没必要用控件。在Form上放上TApplicationEvents,然后
procedure TForm1.ApplicationEvents1Activate(Sender: TObject);
begin
showmessage(程序开始启动);
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
showmessage('程序关闭');
end;

 
同意楼上的
 
关闭还可以写到closequery里,
 
同意myangel,但是用在closequery就有点不合适了。
 
>>来自:jdhx_ren, 时间:2003-5-27 21:58:00, ID:1901097
>>ww



樓主不要太過分了
http://www.delphibbs.com/delphibbs/dispq.asp?lid=1880706
 
顶部