比如:
TForm1= class(TForm)
...
protected
procedure WndProc(var message:Tmessage);override;
//过滤消息
...
end;
.....
const MessageID = WM_User + 100;
//自己定义的消息
implementation
.....
procedure TForm1.WndProc(var message:Tmessage);
begin
if Messages.Msg = MessageID then
messagedlg.....
else
Inherited;//否则正常处理..
end;
在子线程中.....postmessage(form1窗体句柄, MessageID ,0,0);