hide delphi application from taskbar

I am newbie of dephi. I spent a few days to hide the main form from the taskbar. I wrote a application which creates security tunnel and then runs a special program, such as mstsc(MS remote desktop) to connect the remote server via this tunnel.

I tried several ways, none can help me. Even many guys said that application.showmainform shoud be added to the project, and application.restore to onshow. It's weird that the main form was hidden at the beginning, but it's show again after the second program was executed.

At last, one way is worked for me, adding timer to hide the main form after all of initializationes have been done, and the next line to FormCreate

SetWindowLong(Application.Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW)