How to show a secondary form on taskbar using FMX C++?

  

I’m with a little problem when trying to show more than one form on taskbar on the same time.
I found I need to use the following:

WS_EX_APPWINDOW

So I search a little bit more about and then found it:

class TForm2 : public TForm
{
__published: // IDE-managed Components
private: // User declarations
public: // User declarations
__fastcall TForm2(TComponent* Owner);
void __fastcall CreateParams(Controls::TCreateParams &Params);

};

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

However that function works just with VCL (TCreateParams is not a member of Fmx::Controls).

So, I search a little bit more again and found it (This function goes at OnCreate form function):

SetWindowLong(Handle, GWL_EXSTYLE, WS_EX_APPWINDOW);

But I got something wrong saying the following:

[bcc32 Error] Codigo.cpp(19): E2034 Cannot convert ‘TWindowHandle * const’ to ‘HWND__ *’
Full parser context
Codigo.cpp(18): parsing: void _fastcall TfrmCodigo::FormCreate(TObject *)
[bcc32 Error] Codigo.cpp(19): E2342 Type mismatch in parameter ‘hWnd’ (wanted ‘HWND__ *’, got ‘TWindowHandle *’)
Full parser context
Codigo.cpp(18): parsing: void _fastcall TfrmCodigo::FormCreate(TObject *)

Do you know any other alternative to do this?
If you can help me or not, since now, thanks A LOT!

Comments are closed.