Message Firing

Giganews Newsgroups
Subject: Message Firing
Posted by:  Tom Peters (tom_vip…@msn.com)
Date: Thu, 7 Sep 2006

Need to settle an arguement, with a fellow developer.  Let's say I have the
following procedures:

procedure TfmMain.One;
begin
  // do a bunch of stuff
end;

procedure TfmMain.Two;
begin
// do a bunch of stuff
end;

procedure TfmMain.Doit;
begin
  one;
  two;
end;

procedure TfmMain.WMAMESSAGEIMTRAPPING(Msg: TMessage);
begin
doit;
end;

procedure TfmMain.Button1Click(Sender: TObject);
begin
doit;
end;

I click the button & it starts to execute the procs, in doit().  As this
begins, something happens and my app receives the WMAMESSAGEIMTRAPPING. Does
it execute the Doit() proc, while the Button1Click is still executing
(running Doit()). or does it sit in a "message que" and what it's turn to
run?

Replies