T
TMXYB
Unregistered / Unconfirmed
GUEST, unregistred user!
我查看了以往的帖子,但还是有点问题。请看代码:(我的FORM1中有个托盘构件)
#############工程代码##################
begin
Application.Initialize;
[red]一运行即将隐藏窗体(运行成功!)[/red]
Application.ShowMainForm:=false;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
#############窗体最小化代码##############
procedure TForm1.AppMessage(var Msg:TWMSYSCOMMAND);
begin
if msg.CmdType=sc_minimize then
begin
showmessage('最小化,[red]但以下代码全部不成功!!TMD[/red]') ;
// Application.ShowMainForm:=FALSE;
//showwindow(application.handle,sw_hide);
//showwindow(application.mainform.handle,sw_hide);
// showwindow(Application.Handle,sw_hide);//[red]任务栏根本就不消失[/red]
//SetWindowLong (Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
//showwindow(Application.Handle,sw_hide);
// showwindow(form1.Handle,sw_hide);//隐藏窗体
end;
end;
当然运行时是将//去掉了的。
#############工程代码##################
begin
Application.Initialize;
[red]一运行即将隐藏窗体(运行成功!)[/red]
Application.ShowMainForm:=false;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
#############窗体最小化代码##############
procedure TForm1.AppMessage(var Msg:TWMSYSCOMMAND);
begin
if msg.CmdType=sc_minimize then
begin
showmessage('最小化,[red]但以下代码全部不成功!!TMD[/red]') ;
// Application.ShowMainForm:=FALSE;
//showwindow(application.handle,sw_hide);
//showwindow(application.mainform.handle,sw_hide);
// showwindow(Application.Handle,sw_hide);//[red]任务栏根本就不消失[/red]
//SetWindowLong (Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
//showwindow(Application.Handle,sw_hide);
// showwindow(form1.Handle,sw_hide);//隐藏窗体
end;
end;
当然运行时是将//去掉了的。