4
votes

Is there a way, to remove my firemonkey application form Windows XP/vista/7 taskbar? There is no info when i google.

The problem:

How to hide the form that is located in a dll from the Windows taskbar.

1
You can set Application.MainFormOnTaskBar to False. But it has no effect on the resulting app!David Heffernan
Are you writing a true FMX app, or are you just showing a single FMX form as part of a larger VCL app?David Heffernan
@DavidHeffernan: its a dll form, the answer is in first post. Anyways, thank you for trying :)Knobik
Please move the solution part to an answer and mark it as correct.Matthew Strawbridge
@Talibek It would surely be easier to avoid using FMX. What feature of FMX are you using?David Heffernan

1 Answers

2
votes

NB: Talibek answered his own question within the question, for clarity I have moved it here.

You need to get your main form handle (Form1.Handle), because there is no Application.handle in firemonkey, then convert it with FmxHandleToHWND (FMX.Platform.Win) to normal window handle. From your host application, you need to retrive that handle (you can export a function with it) and do this:

  h := GetHandle();

  ShowWindow(h, SW_HIDE);
  SetWindowLong(h, GWL_EXSTYLE, GetWindowLong(h, GWL_EXSTYLE) or 
      WS_EX_TOOLWINDOW);
  ShowWindow(h, SW_SHOW);

Retrieving handle:

class function TForm1.returnHandle(): integer;
begin
  result := FmxHandleToHWND(Form1.Handle);
end;

Of course, the Application.MainFormOnTaskBar property needs to be set to true so the form can handle the application.

Hope it helps somebody.