Michael Marsden wrote:
> In article <331392cf.5487980@[EMAIL PROTECTED]
>, Meikel Weber
> <m.weber@[EMAIL PROTECTED]
> writes
>
> >On 19 Feb 1997 03:07:00 GMT, "Steve Treesh" <streesh@[EMAIL PROTECTED]
>
> >wrote:
> >>....
> >> Form1.close; <--- this doesn't close the window
> >>
> >
> >Why not use "Close" alone without the "Form1." in front of it. But
in
> >fact I think this wouldn't help ...
> >
> >>I've tried using ModalResult := mrCancel immediately before the
> >>close...no luck
> >>I've hooked an OnClose event...no luck.
> >>
> >
> >I experienced these problems some time ago. It is related to the
fact
> >that the form is not yet fully created and shown and somehow the
close
> >message is deleted somewhere (or ignored). I programmed around with
> >posting a user-defined message.
> >Instead of "Form1.Close" do a
> >PostMessage (Handle, WM_USER+101,0, 0);
> >
> >and then add a message handler
> >procedure WMUser101 (var Msg : TMessage); message WM_USER+101;
> >
> >procedure WMUser101;
> >begin
> > Close
> >end;
> >
>
> Try using .Release instead - this basically executes .Close & then
..Free
> via a windows message. Its much safer to use in FormCreate & events
> than .Close or .Free.
>
> -Mike
>
>
-----------------------------------------------------------------------
> Michael Marsden mikemars@[EMAIL PROTECTED]
> Home page -
http://www.webcom.com/mikemars/index.html
> Delphi -
http://www.webcom.com/mikemars/mikedelf.html