Function "ZIP"
Function "ZIP"
in this unit is a function called ZIP to put some files into a zip archive. If the files have a certain size, a small progress dialog (it comes from the "send bug report") pops up. This dialog is quite nice, but the dialogs caption always says "sending bug report". Is there a possibility to change this caption or wasn't this function ment to be used outside of the "send bug report" section?
I wanted to write a little application, that zips one or more files and sends it via email using the sendmapimail function. it seems that the progressdialog comes, when SendMapiMail is called.
heres my code :
heres my code :
Code: Select all
xAttachments := NewAttachments;
for iloop := 1 to ParamCount do
if ParamCount = 1 then filename := ChangeFileExt(ExtractFileName(ParamStr(iloop)),'.zip')
else begin
if ExtractFilePath(ParamStr(iloop)) = '' then
begin
filename := IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0)));
filename := ExtractFileName(copy(filename,1,Length(filename) - 1) + '.zip');
Break;
end;
filename := IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(iloop)));
filename := ExtractFileName(copy(filename,1,Length(filename) - 1) + '.zip');
end;
for iloop := 1 to ParamCount do
if FileExists(ParamStr(iloop)) then
begin
SetLength(arrFiles,Length(arrFiles) + 1);
arrFiles[iloop - 1] := ParamStr(iloop);
xAttachments.Add(ParamStr(iLoop),
ExtractFileName(ParamStr(iLoop)),
filename);
end;
GetTempPath(MAX_PATH,arrCh); sTempDir := IncludeTrailingPathDelimiter(StrPas(arrCh));
Zip(sTempDir + filename,arrFiles);
SendMapiMail('','','',xAttachments);
FreeAndNil(xAttachments);