Delphi2010/XE2下隐藏程序系统任务栏的图标

Delphi7代码:

SetWindowLong(Application.Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW);


以上的代码在Delphi7中可以用,但是在Delphi2010后就开始不行了,搜索了一下,得到办法:

 
1 修改工程文件添加一句:Application.MainFormOnTaskbar := False;
 
2 在主窗体的 OnShow 事件中写下
 
var
Style: Integer;
begin
Style := GetWindowLong(Handle, GWL_EXSTYLE);
SetWindowLong(Handle, GWL_EXSTYLE, Style and (not WS_EX_APPWINDOW));
ShowWindow(Application.Handle, SW_HIDE);
end;
原文地址:https://www.cnblogs.com/xtfnpgy/p/9285401.html