supressing activation of the main form

Hello,

I'v come up with a problem I can't overcome... I have a main form in my
applicatio, there is also another form which has CreateParams overriden:

void __fastcall TForm2::CreateParams(TCreateParams &Params)
{
        TForm::CreateParams(Params);
        Params.ExStyle  |= WS_EX_APPWINDOW;
        Params.WndParent = GetDesktopWindow();

Quote
}

The problem is, that when second form is activated and the main form is in
the background (invisible) and I close the second form, then the main form
becomes activated and jumps onto the top of other windows. I would like to
supress this behavior.

Anybody has an idea which messages should I trap? I tried trapping
WM_NCACTIVATE WM_ACTIVATE in second form while closing it but after it was
closed the main form couldn't be activated manually (by clicking mouse) -
the caption bar was gray and the close button also didn't react.

Thanks for your help
regards
Alex