Hi
This is a part of the folowing topic from borland site.
good luck
Mohamed
"
Oh, one critical point: In order for this to work, the form's KeyPreview property must be set to True. Depending on the way your form handles KeyPress events, you might need to modify a few event handlers to accommodate this feature.
procedure TMainform.FormKeyDown(
Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then begin
if UseTray then Application.Minimize
else if CloseOnEscape then Close;
Key := 0;//optional; could prevent some weirdness
end;
end;
"
A Dozen Tips to Make Your Applications Work Like a Dream
http://www.borland.com/delphi/news/delphi_developer/dozentips.html