program Project1;<br><br>uses<br>Forms,<br>Unit1 in 'Unit1.pas' {Form1},<br>Windows;<br><br>{$R *.RES}<br><br>var<br>ExtendedStyle : Integer;<br><br>begin<br>Application.Initialize;<br><br>//============================================================== <br>ExtendedStyle := GetWindowLong (Application.Handle, GWL_EXSTYLE);<br><br>SetWindowLong(Application.Handle, GWL_EXSTYLE, ExtendedStyle OR WS_EX_TOOLWINDOW<br>AND NOT WS_EX_APPWINDOW);<br>//=============================================================== <br><br>Application.CreateForm(TForm1, Form1);<br>Application.Run;<br>end. <br>///////////////////////////////////////////////////////////////<br> 一般Windows 95运行程序时都会在任务栏上出现按钮,如果你的程序是一个监视程序,那么出现按钮就不是明智之举了。要实现该功能就要在OnCreate事件里利用到API函数SetWindowLong<br>procedure TForm1.FormCreate(sender:TObject);<br>begin<br>SetWindowLong(Application,Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW);<br>end;<br>/////////////////////////////////////////////////////////<br>ShowWindow(Application.Handle, SW_HIDE); <br>SetWindowLong(Application.Handle, GWL_EXSTYLE, <br> GetWindowLong(Application.Handle, GWL_EXSTYLE) <br> or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW); <br>