|
发表于 2006-12-30 18:43:48
|
显示全部楼层
package JustMail;
procedure TMailEditorForm.DoSave(const APrepareSend: Boolean);
Const
cWarning = '您的邮件大小为 %s,限定邮件大小不能超过 %s ';
var
lStream: TStream;
lSaved: Boolean;
MailSize :Integer;
lTemp : String;
begin
if Assigned(OnSave) then
begin
lStream := TMemoryStream.Create;
try
SaveToStream(lStream);
MailSize := lStream.Size;
if MailSize >MaxSize then
begin
lTemp := Format(cWarning,[ConvertSizeToStr(MailSize),MaxSizeStr]);
MessageBox(Handle, PChar(lTemp), '提示', MB_IconWarning or MB_Ok);
FModified := True;
Exit;
end;
lStream.Position := 0;
lSaved := False;
OnSave(Self, lStream, APrepareSend, lSaved);
FModified := not lSaved;
finally
lStream.Free;
end;
end
else
DefaultSave;
end; |
|