Board index » cppbuilder » modeless forms with taskbar buttons

modeless forms with taskbar buttons

How do I create a modeless form that has a button in the taskbar?

Currently I am doing the following to force the parent window to NULL.
(this allows the taskbar button to be created).

void __fastcall TMyForm::FormClose(TObject *Sender,
      TCloseAction &Action)
{
     Action = caFree;

Quote
}

//---------------------------------------------------------------------------

void __fastcall TMyForm::CreateParams(
 Controls::TCreateParams &   _params )
{
 TCustomForm::CreateParams( _params );

     _params.WndParent = 0;

Quote
}

//---------------------------------------------------------------------------

The taskbar button does get created but when it is clicked on, the form
that created this form (MyForm's parent) is
activated

Thanks
Chris

 

Re:modeless forms with taskbar buttons


Quote
> The taskbar button does get created but when it is clicked on, the form
> that created this form (MyForm's parent) is
> activated

I tested your code and it worked fine for me.  The second form was
correctly activated.  How exactly do you create "MyForm"?

--
C++Builder Developer's Network
http://www.cbdn.cjb.net/

Re:modeless forms with taskbar buttons


I created a test project and this code seems to work when TMyForm is
called with:

TMyForm *pForm = new TMyForm(this);
pForm->Show();

There must be something weird in our complete implementation

Thanks
Chris

Other Threads