怎样使程序不出现在任务栏中?(100分)

  • 主题发起人 主题发起人 pkf
  • 开始时间 开始时间
P

pkf

Unregistered / Unconfirmed
GUEST, unregistred user!
请问各位大虾;怎样使程序不出现在任务栏中?
 
这是来自Borland公司的正宗答案:<br>To do this you will need to:<br><br>Select the View -&gt; Project Source, from Delphi's main menu.<br><br>Add the Windows unit to the uses clause.<br><br>Add Application.ShowMainForm := False; to the line after<br>"Application.Initialize;".<br><br>Add: ShowWindow(Application.Handle, SW_HIDE); to the line<br>before "Application.Run;"<br><br>Your main project source file should now look something like<br>this:<br><br>program Project1;<br><br>uses<br>&nbsp; Windows,<br>&nbsp; Forms,<br>&nbsp; Unit1 in 'Unit1.pas' {Form1},<br>&nbsp; Unit2 in 'Unit2.pas' {Form2};<br><br>{$R *.RES}<br><br>begin<br>&nbsp; Application.Initialize;<br>&nbsp; Application.ShowMainForm := False;<br>&nbsp; Application.CreateForm(TForm1, Form1);<br>&nbsp; Application.CreateForm(TForm2, Form2);<br>&nbsp; ShowWindow(Application.Handle, SW_HIDE);<br>&nbsp; Application.Run;<br>end.<br><br>In the "initialization" section (at the very bottom)<br>of each unit that uses a form, add:<br><br>begin<br>&nbsp; ShowWindow(Application.Handle, SW_HIDE);<br>end.<br><br>
 
真麻烦,要么?给我来封mail, 我放你个控件 !!
 
REGISTERSERVICE那么简单的问题<br>RXLIB中有个TAPPEVENT空间也可以达到类似效果,有SOURCE,不错吧
 
在Form的OnShow事件中加一句话:<br><br>ShowWindow(Application.Handle, SW_HIDE);<br><br>Very Simple!
 
多人接受答案了。
 
也可在OnCreate事件中加入代码:<br>&nbsp;SetWindowLong(application.handel,<br>&nbsp; &nbsp; gwl_exstyle,<br>&nbsp; &nbsp; ws_ex_toolwindow);
 
后退
顶部