Delphi Hide program icon in taskbar
Method One:
1, modify the project document "Application.mainformontaskbar: = True;" To "application.mainformontaskbar: = False;"
2. Write down the OnShow event in the main form: ShowWindow (Application.handle, sw_hide);
Method Two:
Change the form style SetWindowLong (Self.handle,gwl_exstyle,ws_ex_toolwindow);
----------------------------------------------------------------------------------------
This program does not display mstasklistwclass in the taskbar
proceduretform1.formshow (sender:tobject);beginShowWindow (application.handle,sw_hide);End;procedureTform1.button1click (sender:tobject);beginShowWindow (Application.handle, sw_hide);//hide icons in taskbarSetWindowLong (Application.handle, Gwl_exstyle, GetWindowLong (Application.handle, Gwl_exstyle)orWs_ex_toolwindow and notWs_ex_appwindow);End; ShowWindow (FindWindow ('Form2'), sw_hide);//Hide FormShowWindow (Form2.handle,sw_hide);//Hide FormShowWindow (Self.handle,sw_hide);//Hide FormShowWindow (FindWindow ('Form2'), Sw_normal);//Show FormShowWindow (Form2.handle,sw_normal);//Show FormShowWindow (Self.handle,sw_normal);//Show FormShowWindow (application.handle,sw_hide);//hide the icon in the taskbar {This sentence does not show the effect in Formcreate}ShowWindow (Application.handle,sw_normal);//show icons in the taskbarSetWindowPos (Application.handle,hwnd_top,0,0,0,0, Swp_hidewindow);//does not appear in the system bar
Reference: http://www.cnblogs.com/xe2011/archive/2012/06/02/2531604.html
Delphi Hide program icon in taskbar