ShowWindow 显示隐藏窗体

SetWindowLong隐藏状态栏的图标
//SetWindowLong隐藏状态栏的图标
//本程序在任务栏中不显示MSTaskListWClass
 
procedure TForm1.FormShow(Sender: TObject);

begin

  ShowWindow(Application.handle,SW_HIDE);

end;

 

 
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowWindow(Application.Handle, SW_HIDE);//隐藏任务栏中的图标
  SetWindowLong(Application.Handle,
            GWL_EXSTYLE,
            GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
end;
///
 
ShowWindow(FindWindow( 'Form2'),SW_HIDE); //隐藏窗体
ShowWindow(Form2.Handle,SW_HIDE); //隐藏窗体
ShowWindow(Self.Handle,SW_HIDE); //隐藏窗体

ShowWindow(FindWindow( 'Form2'),SW_NORMAL); //显示窗体
ShowWindow(Form2.Handle,SW_NORMAL); //显示窗体
ShowWindow(Self.Handle,SW_NORMAL); //显示窗体

ShowWindow(Application.Handle,SW_HIDE); //隐藏任务栏中的图标 {这一句在FormCreate 不能显示出效果的}
ShowWindow(Application.Handle,SW_NORMAL); //显示任务栏中的图标
setwindowpos(application.handle,hwnd_top,0,0,0,0,swp_hidewindow);//不显示在系统栏





你可能感兴趣的:(window)