home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 37 / hot37.iso / FICHEROS / 9TOOL / ADDZIP.ZIP / DELPHI / ZWIZ.PAS < prev   
Pascal/Delphi Source File  |  1998-02-01  |  21KB  |  778 lines

  1. unit Zwiz;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, ExtCtrls, StdCtrls, Buttons, FileCtrl, azip, addzipu, addzipc;
  8.  
  9. type
  10.   TfrmWizard = class(TForm)
  11.     imgWizard: TImage;
  12.     grpStep1: TGroupBox;
  13.     lblArchiveName: TLabel;
  14.     edtArchive: TEdit;
  15.     shpLine: TShape;
  16.     btnCancel: TSpeedButton;
  17.     btnBack: TSpeedButton;
  18.     btnNext: TSpeedButton;
  19.     btnFinish: TSpeedButton;
  20.     btnBrowse: TSpeedButton;
  21.     grpStep2: TGroupBox;
  22.     grpStep3: TGroupBox;
  23.     grpStep4: TGroupBox;
  24.     grpStep5: TGroupBox;
  25.     GroupBox1: TGroupBox;
  26.     grpPassword: TGroupBox;
  27.     grpCompression: TGroupBox;
  28.     radPathNo: TRadioButton;
  29.     radPathYes: TRadioButton;
  30.     radPasswordYes: TRadioButton;
  31.     radPasswordNo: TRadioButton;
  32.     lblPassword: TLabel;
  33.     edtPassword: TEdit;
  34.     radCompressNone: TRadioButton;
  35.     radCompressMinimum: TRadioButton;
  36.     radCompressNormal: TRadioButton;
  37.     radCompressMaximum: TRadioButton;
  38.     lblFiles: TLabel;
  39.     lstFiles: TFileListBox;
  40.     dirFiles: TDirectoryListBox;
  41.     drvFiles: TDriveComboBox;
  42.     btnAdd: TSpeedButton;
  43.     btnRemove: TSpeedButton;
  44.     lstSelected: TListBox;
  45.     grpMultiDisk: TGroupBox;
  46.     radMultiNo: TRadioButton;
  47.     radMultiYes: TRadioButton;
  48.     grpLFN: TGroupBox;
  49.     radLFNYes: TRadioButton;
  50.     radLFNNo: TRadioButton;
  51.     grpComment: TGroupBox;
  52.     radCommentNo: TRadioButton;
  53.     radCommentYes: TRadioButton;
  54.     mmoComment: TMemo;
  55.     mmoSummary: TMemo;
  56.     edtHidden: TEdit;
  57.     lblInfo: TLabel;
  58.     chkSFX: TCheckBox;
  59.     procedure btnCancelClick(Sender: TObject);
  60.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  61.     procedure FormShow(Sender: TObject);
  62.     procedure btnBackClick(Sender: TObject);
  63.     procedure btnNextClick(Sender: TObject);
  64.     procedure edtArchiveChange(Sender: TObject);
  65.     procedure btnFinishClick(Sender: TObject);
  66.     procedure btnAddClick(Sender: TObject);
  67.     procedure btnRemoveClick(Sender: TObject);
  68.     procedure lstFilesClick(Sender: TObject);
  69.     procedure dirFilesChange(Sender: TObject);
  70.     procedure radCommentNoClick(Sender: TObject);
  71.     procedure radCommentYesClick(Sender: TObject);
  72.     procedure radPasswordNoClick(Sender: TObject);
  73.     procedure radPasswordYesClick(Sender: TObject);
  74.     procedure btnBrowseClick(Sender: TObject);
  75.     procedure edtHiddenChange(Sender: TObject);
  76.   private
  77.     { Private declarations }
  78.     procedure AlignGroups;
  79.     procedure HideGroup(GroupNum : Integer);
  80.     procedure ShowGroup(GroupNum : Integer);
  81.     Function CheckFloppyDrives (cFileName : String) : Boolean;
  82.     procedure DisplaySummary;
  83.     function Trim(s : string) : string;
  84.     procedure WMGetMinMaxInfo(var MSG: Tmessage); message WM_GetMinMaxInfo;
  85.   public
  86.     { Public declarations }
  87.     procedure DOZip;
  88.   end;
  89.  
  90. {$IFDEF USE_CALLBACKS}
  91.   Type
  92.      {$IFNDEF WIN32} Short = ShortInt; {$ENDIF}
  93.      TProcessCallbackData = function (iLibrary, iMessage : Short; pInfo : PChar) : Integer;
  94.      {$IFDEF WIN32} stdcall; {$ENDIF}
  95.  
  96.  
  97.   function ProcessCallbackData(iLibrary, iMessage : Short; pInfo : PChar) : Integer;
  98.            {$IFDEF WIN32} stdcall; {$ENDIF} export;
  99. {$ENDIF}
  100.  
  101. var
  102.   frmWizard: TfrmWizard;
  103.   m_iStep : Integer;
  104.   {$IFDEF WIN32}
  105.   sArchiveName : String[255];
  106.   {$ELSE}
  107.   sArchiveName : String[128];
  108.   {$ENDIF}
  109.   {$IFDEF USE_CALLBACKS}
  110.   MyCallback : TProcessCallbackData;
  111.   {$ENDIF}
  112.   Const m_cMaxSteps = 5;
  113.  
  114. implementation
  115.  
  116. {$R *.DFM}
  117.  
  118. procedure TfrmWizard.btnCancelClick(Sender: TObject);
  119. begin
  120.    Close;
  121. end;
  122.  
  123. procedure TfrmWizard.FormClose(Sender: TObject; var Action: TCloseAction);
  124. begin
  125.    Action := caFree;
  126. end;
  127.  
  128. procedure TfrmWizard.FormShow(Sender: TObject);
  129. var
  130.    I: Integer;
  131. begin
  132.     I := addZIP_SetParentWindowHandle(frmWizard.Handle);
  133.     {$IFDEF USE_CALLBACKS}
  134.     MyCallback := ProcessCallBackData;
  135.     I := addZip_InstallCallback(@MyCallback);
  136.     {$ELSE}
  137.     I := addZIP_SetWindowHandle(edtHidden.Handle);
  138.     {$ENDIF}
  139.     addZIP_Initialise;
  140.     m_iStep := 1;
  141.     AlignGroups;
  142.     grpStep1.Visible := True;
  143.     grpStep2.Visible := False;
  144.     grpStep3.Visible := False;
  145.     grpStep4.Visible := False;
  146.     grpStep5.Visible := False;
  147.     mmoSummary.Color := clBtnFace;
  148.  
  149. end;
  150.  
  151. procedure TfrmWizard.AlignGroups;
  152. begin
  153.    grpStep2.Top := GrpStep1.Top;
  154.    grpStep2.Left := GrpStep1.Left;
  155.    grpStep2.Width := GrpStep1.Width;
  156.    grpStep2.Height := GrpStep1.height;
  157.    grpStep3.Top := GrpStep1.Top;
  158.    grpStep3.Left := GrpStep1.Left;
  159.    grpStep3.Width := GrpStep1.Width;
  160.    grpStep3.Height := GrpStep1.height;
  161.    grpStep4.Top := GrpStep1.Top;
  162.    grpStep4.Left := GrpStep1.Left;
  163.    grpStep4.Width := GrpStep1.Width;
  164.    grpStep4.Height := GrpStep1.height;
  165.    grpStep5.Top := GrpStep1.Top;
  166.    grpStep5.Left := GrpStep1.Left;
  167.    grpStep5.Width := GrpStep1.Width;
  168.    grpStep5.Height := GrpStep1.height;
  169.  
  170. end;
  171.  
  172. procedure TfrmWizard.btnBackClick(Sender: TObject);
  173. begin
  174.     If (m_iStep > 1) Then
  175.        begin
  176.           HideGroup(m_iStep);
  177.           If (m_iStep = m_cMaxSteps) Then
  178.               btnNext.Enabled := True;
  179.           m_iStep := m_iStep - 1;
  180.           If (m_iStep = 1) Then
  181.               btnBack.Enabled := False;
  182.           ShowGroup(m_iStep);
  183.        End;
  184.  
  185. end;
  186.  
  187. procedure TfrmWizard.HideGroup(GroupNum : Integer);
  188. begin
  189.   case GroupNum of { which group to disable }
  190.   1 : begin
  191.          grpStep1.Visible := False
  192.       end;
  193.   2 : begin
  194.          grpStep2.Visible := False
  195.       end;
  196.   3 : begin
  197.          grpStep3.Visible := False
  198.       end;
  199.   4 : begin
  200.          grpStep4.Visible := False
  201.       end;
  202.   5 : begin
  203.          grpStep5.Visible := False
  204.       end;
  205.   end; { case }
  206. end;
  207.  
  208. procedure TfrmWizard.ShowGroup(GroupNum : Integer);
  209. begin
  210.   case GroupNum of { which group to disable }
  211.   1 : begin
  212.          grpStep1.Visible := True
  213.       end;
  214.   2 : begin
  215.          grpStep2.Visible := True
  216.       end;
  217.   3 : begin
  218.          grpStep3.Visible := True
  219.       end;
  220.   4 : begin
  221.          grpStep4.Visible := True
  222.       end;
  223.   5 : begin
  224.          grpStep5.Visible := True
  225.       end;
  226.   end; { case }
  227. end;
  228.  
  229. procedure TfrmWizard.btnNextClick(Sender: TObject);
  230. begin
  231.  
  232.  
  233.     If (m_iStep < m_cMaxSteps) Then
  234.        begin
  235.           HideGroup(m_iStep);
  236.           If (m_iStep = 1) Then
  237.               btnBack.Enabled := True;
  238.               If (Pos(':', edtArchive.Text) > 0) Then
  239.                  begin
  240.                     If CheckFloppyDrives(edtArchive.Text) = False Then
  241.                        begin
  242.                           grpMultiDisk.Enabled := False;
  243.                           radMultiNo.Enabled := False;
  244.                           radMultiYes.Enabled := False;
  245.                        end
  246.                     Else
  247.                         begin
  248.                            grpMultiDisk.Enabled := True;
  249.                            radMultiNo.Enabled := True;
  250.                            radMultiYes.Enabled := True;
  251.                         end
  252.                  end
  253.               Else
  254.                  begin
  255.                     grpMultiDisk.Enabled := False;
  256.                     radMultiNo.Enabled := False;
  257.                     radMultiYes.Enabled := False;
  258.                  End
  259.           End;
  260.           m_iStep := m_iStep + 1;
  261.           If (m_iStep = m_cMaxSteps) Then
  262.              begin
  263.                 btnNext.Enabled := False;
  264.                 DisplaySummary;
  265.              End;
  266.           ShowGroup(m_iStep);
  267.     End;
  268.  
  269.  
  270. Function TfrmWizard.CheckFloppyDrives (cFileName : String) : Boolean;
  271. var
  272.    {$IFDEF WIN32}
  273.    pFileName : PChar;
  274.    wResult : Word;
  275.    {$ELSE}
  276.    Drive : String;
  277.    DriveNumber, wResult : Word;
  278.    {$ENDIF}
  279. begin
  280.  
  281.    CheckFloppyDrives := False;
  282.  
  283.    {$IFDEF WIN32}
  284.    pFileName := StrAlloc(2);
  285.    StrPCopy(pFileName, Copy(UpperCase(cFileName), 1, 1));
  286.    wResult := GetDriveType(pFileName);
  287.    StrDispose(pFileName);
  288.    {$ELSE}
  289.    Drive := UpperCase(Copy(cFileName, 1, 1));
  290.    DriveNumber := Ord(Drive[1]) - 65;  {Drive must be upper case}
  291.    wResult := Word(GetDriveType(DriveNumber));
  292.    {$ENDIF}
  293.  
  294.    If wResult = DRIVE_REMOVABLE then
  295.       CheckFloppyDrives := True;
  296. End;
  297.  
  298. procedure TfrmWizard.DisplaySummary;
  299. var
  300.   sSummary, sResult : String;
  301.   I : Integer;
  302.   sFill : array[1..10] of Char;
  303. begin
  304.     sFill := '          ';
  305.     mmoSummary.Clear;
  306.  
  307.     sSummary := 'Compress the following ' + IntToStr(lstSelected.Items.Count) + ' file';
  308.     If (lstSelected.items.Count > 1) Then
  309.         sSummary := sSummary + 's';
  310.  
  311.    If chkSFX.State = cbChecked then
  312.       begin
  313.          sResult := ChangeFileExt(edtArchive.Text, '.exe');
  314.          sSummary := sSummary + ' to the archive ' + sResult + '.';
  315.       end
  316.    Else
  317.       sSummary := sSummary + ' to the archive ' + edtArchive.Text + '.';
  318.  
  319.     mmoSummary.Lines.Add(sSummary);
  320.     mmoSummary.Lines.Add('');
  321.  
  322.     For I := 0 To lstSelected.items.Count - 1 do
  323.         begin
  324.            sSummary := sFill + lstSelected.Items[I];
  325.            mmoSummary.Lines.Add(sSummary);
  326.         end;
  327.  
  328.     mmoSummary.Lines.Add('');
  329.  
  330.     sSummary := 'Selected options ';
  331.     mmoSummary.Lines.Add(sSummary);
  332.  
  333.     If (radPathYes.Checked = True) Then
  334.         sSummary := sFill + 'Full path information saved'
  335.     Else
  336.         sSummary := sFill + 'Only filenames saved';
  337.  
  338.     mmoSummary.Lines.Add(sSummary);
  339.  
  340.     If (radPasswordYes.Checked = True) Then
  341.         sSummary := sFill + 'Files will be encrypted'
  342.     Else
  343.         sSummary := sFill + 'Files will not be encrypted';
  344.  
  345.     mmoSummary.Lines.Add(sSummary);
  346.  
  347.     If (radCompressNone.Checked = True) Then
  348.         sSummary := sFill + 'Files will be stored without compression'
  349.     Else If (radCompressMinimum.Checked = True) Then
  350.         sSummary := sFill + 'Files will hame minimum compressed'
  351.     Else If (radCompressNormal.Checked = True) Then
  352.         sSummary := sFill + 'Files will have normal compression'
  353.     Else
  354.         sSummary := sFill + 'Files will have maximum compression';
  355.  
  356.     mmoSummary.Lines.Add(sSummary);
  357.  
  358.     If (radMultiYes.Checked = True) Then
  359.         sSummary := sFill + 'Archive may span multiple disks'
  360.     Else
  361.         sSummary := sFill + 'Archive will not span disks';
  362.  
  363.     mmoSummary.Lines.Add(sSummary);
  364.  
  365.     If (radLFNYes.Checked = True) Then
  366.         sSummary := sFill + 'Long filenames will be stored'
  367.     Else
  368.         sSummary := sFill + 'Short (8.3) filenames will be stored';
  369.  
  370.     mmoSummary.Lines.Add(sSummary);
  371.  
  372.     If (radCommentYes.Checked = True) Then
  373.        begin
  374.           sSummary := sFill + 'Archive will have a comment added';
  375.           mmoSummary.Lines.Add(sSummary);
  376.        end;
  377. end;
  378.  
  379. procedure TfrmWizard.edtArchiveChange(Sender: TObject);
  380. begin
  381.     If (Length(edtArchive.Text) = 0) Then
  382.         btnNext.Enabled := False
  383.     Else
  384.         btnNext.Enabled := True;
  385. end;
  386.  
  387. {Supresses leading and trailing blanks}
  388. function TfrmWizard.Trim(s : string) : string;
  389. var
  390.   sLen : byte absolute s;
  391. begin
  392.   while (sLen>0) and (s[1] in [' ',^I]) do
  393.     Delete(s,1,1);
  394.  
  395.   while (sLen>0) and (s[sLen] in [' ',^I]) do
  396.     Dec(sLen);
  397.  
  398.   result:=s;
  399. end;
  400.  
  401. procedure TfrmWizard.btnFinishClick(Sender: TObject);
  402. var
  403.    iResult : Integer;
  404.    pMsg : PChar;
  405. begin
  406.    pMsg := StrAlloc(80);
  407.  
  408.    If (grpStep5.Visible = False) Then
  409.        begin
  410.           DisplaySummary;
  411.           HideGroup(m_iStep);
  412.           ShowGroup(m_cMaxSteps);
  413.           m_iStep := m_cMaxSteps;
  414.        End;
  415.  
  416.    StrCopy(pMsg, 'You are about to start creating the archive.' +  #13#13 + 'Press OK to proceed, Cancel to quit.');
  417.    iResult := Application.MessageBox(pMsg, 'Zip Wizard', MB_APPLMODAL + MB_OKCANCEL + MB_ICONQUESTION);
  418.    If iResult = IDOK then
  419.       begin
  420.          sArchiveName := edtArchive.Text;
  421.          DOZIP;
  422.       end;
  423.  
  424.    StrCopy(pMsg, 'Finished creating archive.');
  425.    iResult := Application.MessageBox(pMsg, 'Zip Wizard', MB_APPLMODAL + MB_OK + MB_ICONINFORMATION);
  426.  
  427.    StrDispose(pMsg);
  428.  
  429.    Close;
  430. end;
  431.  
  432. procedure TfrmWizard.btnAddClick(Sender: TObject);
  433. var
  434.    sFilename : String;
  435. begin
  436.     sFilename := lstFiles.Filename;
  437.     lstSelected.Items.Add(LowerCase(sFilename));
  438.     If (lstSelected.items.Count = 1) Then
  439.        begin
  440.           btnNext.Enabled := True;
  441.           btnFinish.Enabled := True;
  442.           btnRemove.Enabled := True;
  443.        end;
  444.  
  445. end;
  446.  
  447. procedure TfrmWizard.btnRemoveClick(Sender: TObject);
  448. begin
  449.     lstSelected.Items.Delete(lstSelected.ItemIndex);
  450.     If (lstSelected.Items.Count = 0) Then
  451.        begin
  452.           btnNext.Enabled := False;
  453.           btnFinish.Enabled := False;
  454.           btnRemove.Enabled := False;
  455.        End;
  456.  
  457. end;
  458.  
  459. procedure TfrmWizard.lstFilesClick(Sender: TObject);
  460. begin
  461.    btnAdd.Enabled := True;
  462. end;
  463.  
  464. procedure TfrmWizard.dirFilesChange(Sender: TObject);
  465. begin
  466.    btnAdd.Enabled := False;
  467. end;
  468.  
  469. procedure TfrmWizard.radCommentNoClick(Sender: TObject);
  470. begin
  471.     If (radCommentNo.Checked = True) Then
  472.         mmoComment.Enabled := False;
  473. end;
  474.  
  475. procedure TfrmWizard.radCommentYesClick(Sender: TObject);
  476. begin
  477.     If (radCommentYes.Checked = True) Then
  478.        mmoComment.Enabled := True;
  479. end;
  480.  
  481. procedure TfrmWizard.radPasswordNoClick(Sender: TObject);
  482. begin
  483.     If (radPasswordNo.Checked = True) Then
  484.        begin
  485.           edtPassword.Enabled := False;
  486.           lblPassword.Enabled := False;
  487.        End;
  488. end;
  489.  
  490. procedure TfrmWizard.radPasswordYesClick(Sender: TObject);
  491. begin
  492.     If (radPasswordYes.Checked = True) Then
  493.        begin
  494.           edtPassword.Enabled := True;
  495.           lblPassword.Enabled := True;
  496.        End;
  497. end;
  498.  
  499. procedure TfrmWizard.btnBrowseClick(Sender: TObject);
  500. begin
  501.  
  502.    with TOpenDialog.Create(Self) do
  503.    try
  504.       Title := 'Enter a name for a .ZIP archive';
  505.       Filename := '';
  506.       InitialDir := ExtractFilepath(Application.ExeName);
  507.       DefaultExt := '.ZIP';
  508.       Filter := 'ZIP Files (*.ZIP)|*.ZIP|All Files (*.*)|*.*';
  509.       FilterIndex := 1;
  510.       HelpContext := 0;
  511.       Options := Options + [ofPathMustExist];
  512.  
  513.       if Execute then
  514.          begin
  515.             If Trim(Filename) <> '' Then
  516.                edtArchive.Text := Filename
  517.             Else
  518.                edtArchive.Text := '';
  519.          End
  520.       Else
  521.          edtArchive.Text := ''
  522.    finally
  523.      Free
  524.    end;
  525.  
  526. end;
  527.  
  528. procedure TfrmWizard.WMGetMinMaxInfo(var MSG: Tmessage);
  529. Begin
  530.   inherited;
  531.   with PMinMaxInfo(MSG.lparam)^ do
  532.   begin
  533.     with ptMaxTrackSize do
  534.     begin
  535.       X := 504;
  536.       Y := 440;
  537.     end;
  538.     with ptMinTrackSize do
  539.     begin
  540.       X := 504;
  541.       Y := 440;
  542.     end;
  543.   end;
  544. end;
  545.  
  546. procedure TfrmWizard.DOZip;
  547. var
  548.    {$IFDEF WIN32}
  549.    sTempFile : String[255];
  550.    {$ELSE}
  551.    sTempFile : String[128];
  552.    {$ENDIF}
  553.    sResult : String;
  554.    pPassWord, pTempFile, pArchiveName, pFiles : PChar;
  555.    I : Integer;
  556. begin
  557.  
  558.    pFiles := StrAlloc(65526);
  559.    {$IFDEF WIN32}
  560.    pArchiveName := StrAlloc(255);
  561.    pTempFile := StrAlloc(255);
  562.    {$ELSE}
  563.    pArchiveName := StrAlloc(127);
  564.    pTempFile := StrAlloc(127);
  565.    {$ENDIF}
  566.  
  567.    If chkSFX.State = cbChecked then
  568.       begin
  569.          i := addZIP_BuildSFX(True);
  570.          sResult := ChangeFileExt(sArchiveName, '.EXE');
  571.          sArchiveName := sResult;
  572.       end;
  573.  
  574.     { Set the name of the archive}
  575.    StrPCopy(pArchiveName, sArchiveName);
  576.    I := addZIP_ArchiveName(pArchiveName);
  577.  
  578.    { Create pipe-delimited list of files and call the appropriate function}
  579.    StrCopy(pFiles, '');
  580.    For I := 0 To lstSelected.Items.Count - 1 do
  581.        begin
  582.           sTempFile := Trim(lstSelected.Items[I]) + '|';
  583.           StrCopy(pTempFile, '');
  584.           StrPCopy(pTempFile, sTempFile);
  585.           StrCat(pFiles, pTempFile);
  586.        end;
  587.  
  588.    I := addZIP_Include(pFiles);
  589.  
  590.    If (radPathYes.Checked = True) Then
  591.        I := addZIP_SaveStructure(azSTRUCTURE_ABSOLUTE)
  592.    Else
  593.        I := addZIP_SaveStructure(azSTRUCTURE_RELATIVE);
  594.  
  595.    If (radPasswordYes.Checked = True) Then
  596.       begin
  597.          pPassWord := StrAlloc(Length(edtPassword.Text) + 1);
  598.          StrPCopy(pPassWord, edtPassword.Text);
  599.          I := addZIP_Encrypt(pPassword);
  600.          StrDispose(pPassWord);
  601.       end;
  602.  
  603.    If (radCompressNone.Checked = True) Then
  604.        I := addZIP_SetCompressionLevel(azCOMPRESSION_NONE)
  605.    Else If (radCompressMinimum.Checked = True) Then
  606.        I := addZIP_SetCompressionLevel(azCOMPRESSION_MINIMUM)
  607.    Else If (radCompressNormal.Checked = True) Then
  608.        I := addZIP_SetCompressionLevel(azCOMPRESSION_NORMAL)
  609.    Else
  610.        I := addZIP_SetCompressionLevel(azCOMPRESSION_MAXIMUM);
  611.  
  612.    If (radMultiYes.Checked = True) Then
  613.        I := addZIP_Span(True)
  614.    Else
  615.        I := addZIP_Span(False);
  616.  
  617.    If (radLFNYes.Checked = True) Then
  618.        I := addZIP_UseLFN(True)
  619.    Else
  620.        I := addZIP_UseLFN(False);
  621.  
  622.    If (radCommentYes.Checked = True) Then
  623.       begin
  624.          I := addZIP_Comment(mmoComment.Lines.GetText);
  625.       end;
  626.  
  627.    I := addZIP;
  628.  
  629.    StrDispose(pFiles);
  630.    StrDispose(pArchiveName);
  631.    StrDispose(pTempFile);
  632. end;
  633.  
  634. {$IFDEF USE_CALLBACKS}
  635. function ProcessCallbackData(iLibrary, iMessage : Short; pInfo : PChar) : Integer;
  636.          {$IFDEF WIN32} stdcall; {$ENDIF}
  637. var
  638.    cAdditem : String;
  639. begin
  640.     With frmWizard do
  641.        Case iMessage of
  642.             AM_SEARCHING : begin
  643.                 {comment}
  644.                 end;
  645.             AM_ZIPCOMMENT : begin
  646.                 {comment}
  647.                  end;
  648.             AM_ZIPPING : begin
  649.                 cAdditem := ' Zipping ' + ExtractFileName(GetCompFileName(StrPas(pInfo)));
  650.                 cAdditem := cAdditem + ' - ' + GetPercentComplete(StrPas(pInfo));
  651.                 lblInfo.Caption := cAdditem;
  652.                 lblInfo.Update;
  653.                 end;
  654.             AM_ZIPPED : begin
  655.                 {comment}
  656.                  end;
  657.             AM_UNZIPPING : begin
  658.                 {comment}
  659.                  end;
  660.             AM_UNZIPPED : begin
  661.                 {comment}
  662.                  end;
  663.             AM_TESTING : begin
  664.                 {comment}
  665.                  end;
  666.             AM_TESTED : begin
  667.                 {comment}
  668.                  end;
  669.             AM_DELETING : begin
  670.                 {comment}
  671.                  end;
  672.             AM_DELETED : begin
  673.                 {comment}
  674.                  end;
  675.             AM_DISKCHANGE : begin
  676.                {comment}
  677.                 end;
  678.             AM_VIEW : begin
  679.                {comment}
  680.                 end;
  681.             AM_ERROR : begin
  682.                {error}
  683.                 end;
  684.             AM_WARNING : begin
  685.                {warning}
  686.                 end;
  687.             AM_QUERYOVERWRITE : begin
  688.                 {
  689.                 I have set the overwrite query option to default to NO to avoid a GPF
  690.                 when the replace dialog (from QuickZip) is displayed
  691.                 }
  692.                 {ProcessCallbackData := azOW_YES;}
  693.                 {ProcessCallbackData := azOW_YES_TO_ALL;}
  694.                 ProcessCallbackData := azOW_NO;
  695.                 {ProcessCallbackData := azOW_NO_TO_ALL;}
  696.  
  697.                 end;
  698.             AM_COPYING : begin
  699.             {comment}
  700.                 end;
  701.             AM_COPIED : begin
  702.             {comment}
  703.                 end;
  704.         end;
  705. end;
  706. {$ENDIF}
  707.  
  708. procedure TfrmWizard.edtHiddenChange(Sender: TObject);
  709. {$IFNDEF USE_CALLBACKS}
  710. var
  711.    cAdditem : String;
  712.    iAction : Integer;
  713. {$ENDIF}
  714. begin
  715. {$IFNDEF USE_CALLBACKS}
  716.     iAction := StrToInt(GetAction((edtHidden.Text)));
  717.  
  718.     Case iAction of
  719.         AM_SEARCHING : begin
  720.             {comment}
  721.             end;
  722.         AM_ZIPCOMMENT : begin
  723.             {comment}
  724.              end;
  725.         AM_ZIPPING : begin
  726.           cAdditem := 'Zipping ' + GetPiece((edtHidden.Text), '|', 4);
  727.           cAdditem := cAdditem + ' - ' + GetPercentComplete((edtHidden.Text));
  728.           lblInfo.Caption := cAdditem;
  729.           lblInfo.Update;
  730.             end;
  731.         AM_ZIPPED : begin
  732.             {comment}
  733.              end;
  734.         AM_UNZIPPING : begin
  735.             {comment}
  736.             end;
  737.         AM_UNZIPPED : begin
  738.             {comment}
  739.              end;
  740.         AM_TESTING : begin
  741.             {comment}
  742.              end;
  743.         AM_TESTED : begin
  744.             {comment}
  745.              end;
  746.         AM_DELETING : begin
  747.             {comment}
  748.              end;
  749.         AM_DELETED : begin
  750.             {comment}
  751.              end;
  752.         AM_DISKCHANGE : begin
  753.             {comment}
  754.              end;
  755.         AM_VIEW : begin
  756.             {comment}    
  757.            end;
  758.         AM_ERROR : begin
  759.             {error}
  760.              end;
  761.         AM_WARNING : begin
  762.             {warning}
  763.              end;
  764.         AM_QUERYOVERWRITE : begin
  765.             {comment}
  766.              end;
  767.         AM_COPYING : begin
  768.             {comment}
  769.              end;
  770.         AM_COPIED : begin
  771.             {comment}
  772.              end;
  773.     end;
  774. {$ENDIF}
  775. end;
  776.  
  777. end.
  778.