Menu

#7 Request for different behavior from "Close" menu item.

open
nobody
StTrayIcon (3)
7
2013-01-15
2003-01-29
Anonymous
No

Exported from Bugzilla, issue 3636.

--- Comment added on 8/7/02 4:49:03 PM ---
Customer doesn't like PostQuitMessage in the DoCloseClick event, says it
bypasses OnCloseQuery/OnClose event handlers.

procedure TStCustomTrayIcon.DoCloseClick(Sender: TObject);
begin
TForm(Owner).Close; {!!.02}
// PostQuitMessage(0); {!!.02}
end;

Application.MainForm.Close has also been suggested.

Problems:

Having to include the Forms unit
Assuming the component is owned by a TForm
Assuming the availability of the Application object

Alternative(??):

PostMessage(TForm(Owner).Handle, WM_CLOSE, 0, 0);

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.