Even with a trayicon there has to be a mainform for the application. How are you using it, ( the trayicon )? For application where I need a trayicon but do not want it to effect or be effected by anything happening to or with the user interface, I usually create a dummy form as my mainform with no borders, icons, or anything but the trayicon, an imagelist, and the context menu used by the trayicon. I set ShowMainForm to false and never show it. But that still doesn't preclude making use of it's OnClose or OnCreate events.
>From "Robert Meek" Personal e-mail: [EMAIL PROTECTED] dba / "Tangentals Design" Visit us at: www.TangentalsDesign.com Home of "The Keep"! Member of: "Association of Shareware Professionals" Moderator for: "The Delphi", "Delphi-DB", and "Delphi-Talk" programming lists at elists.org, and proud to be a donator to the Jedi VCL 3.0. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ross Levis Sent: Friday, May 13, 2005 7:57 AM To: Borland's Delphi Discussion List Subject: finalization I'm trying to establish the best event to destroy objects etc when my program is closing down. The OnFormClose (of the mainform) is where I normally do this in other programs but an app I'm working on right now minimizes to the system tray so there is no mainform to close when the program is terminated. I need access to some other forms before they are destroyed, so I can't use the OnDestroy event of the mainform, as I believe this occurs last after all other forms are destroyed. The code needs to run if Windows is shutdown as well. Does anyone have any suggestions? Regards, Ross. _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

