| 发表于:2008-01-12 10:46:10 楼主 |
function showinfo(msg: string; imode: integer):integer; begin case imode of 1: result:=application.messagebox(pchar(msg+' '),'提示信息',mb_ok); 2: result:=application.messagebox(pchar(msg),pchar(application.mainform.caption),mb_yesno+mb_iconquestion); 3: result:=application.messagebox(pchar(msg+' '),'错误信息',mb_ok); 4: result:=application.messagebox(pchar(msg+' '),'警告信息',mb_ok); else result := 0; end; end; procedure tfmain.formclosequery(sender: tobject; var canclose: boolean); begin canclose := false ; if showinfo(globalerror.exitconfirm,2)= idyes then //messagebox 与托盘冲突 导致系统变慢 begin //关闭10000端口监听 idudpclient.active := false ; idudpservermain.active := false; for i:= 0 to self.mdichildcount-1 do self.mdichildren[i].close ; //设置窗体风格 if curskinindex <> regskinindex then begin wirteregedit('skinindex', encrypt(inttostr(curskinindex),256)); end; canclose := true ; end; end; |
|
|
|
|