Hi all.
I have been having quite a battle with closing forms lately as you have seen.
If anyone falls into the same trap in future, the key is whether the form is
visible or not.
Here is an example I have just sorted the line is between the **************

    if (lowercase(paramstr(2)) <> 'close') and (lowercase(paramstr(2)) <> 'shutdown') 
then
      Msgbox(errstring + IntToStr(SuccessCnt) + ' file' + IsOne + ' added', '', true, 
MB_OK)
    else
    begin
      if (lowercase(paramstr(2)) = 'shutdown') then closing := true;
      RxTrayIcon1.Active := false;
//*****************************
      Exit1click(self);        //if this is 'close;' it does not work
//*****************************
    end;


procedure TMainform.Exit1Click(Sender: TObject);
begin
  if application.ShowMainForm = false then application.Terminate
  else close;
end;

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to