Neftalí he adaptado la idea para algo que tenía pendiente y parece funcionar pulsando en la barra. En Delphi 7 sobre XP.
Código Delphi
[-]
procedure SysCommand(var Msg: TMessage); message wm_SysCommand;
procedure TfMain.SysCommand(var Msg: TMessage);
begin
if Msg.wParam = sc_Close then
dmdatos.fdmdatos.acCerrarApp.Execute
else
begin
if Msg.wParam = SC_MINIMIZE then
Application.Minimize
else
inherited; ;
end;
end;