MainformOnTaskBar and Citrix

After upgrading from BDS 2006 to Delphi 2007, we discovered a Problem when running the Application under Citrix Metaframe Server 4. The Application was compiled with MainformOnTaskBar set to true and created a "second" button in the Taskbar without a Caption. Obviously, this had to with the hidden Application window of a Delphi Application. The problem can be solved, by setting the window style of this hidden window with the following code:

begin
Application.Initialize;
SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE)
or WS_EX_TOOLWINDOW);

References:
http://www.delphipraxis.net/post867089.html