type
TForm1 = class(TForm)
protected
procedure CreateParams(var Params: TCreateParams); override;
....
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
// change window style to have an icon in the taskbar
// to do this we add WS_EX_APPWINDOW to the window style parameters
// for more info ,look into MS win32 help reference on msdn
inherited CreateParams(Params);
ParentWindow:=GetDesktopWindow; // make sure desktop is owner of this form, if not, taskbar button will not function properly
Params.ExStyle := WS_EX_APPWINDOW;
end;