4

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.

Richard Stelling
  • 25,607
  • 27
  • 108
  • 188
Knobik
  • 383
  • 8
  • 26

1 Answers1

2

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.

Community
  • 1
  • 1
Richard Stelling
  • 25,607
  • 27
  • 108
  • 188
  • 1
    `Application.MainFormOnTaskBar` appears to be declared as a public field and then never references, at least in the FMX source that I can see. – David Heffernan Jan 02 '12 at 16:48