这里有所有相关参数的解释: http://www.cnblogs.com/del/archive/2008/04/15/1154359.html

//最大化窗口
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.Style := Params.Style or WS_MAXIMIZE; {WS_MINIMIZE 是最小化}
end;


//取消系统菜单(如果没法关闭就用 Alt+F4 吧)
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.Style := Params.Style and not WS_SYSMENU;
end;


//取消能够调整大小的边框
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.Style := Params.Style and not WS_THICKFRAME;
end;


//在所有非顶层窗口的最上面
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.ExStyle := Params.ExStyle or WS_EX_TOPMOST;
end;


//工具窗口
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.ExStyle := Params.ExStyle or WS_EX_TOOLWINDOW;
end;


//带阴影边界, 有这 MDI 窗口的视觉
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.ExStyle := Params.ExStyle or WS_EX_CLIENTEDGE;
end;


//带帮助按钮
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.Style := Params.Style and not (WS_MINIMIZEBOX or WS_MAXIMIZEBOX);
  Params.ExStyle := Params.ExStyle or WS_EX_CONTEXTHELP;
end;

//隐藏标题栏
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.Style := WS_DLGFRAME or WS_POPUP;
end;

posted on 2008-09-02 17:18  万一  阅读(8154)  评论(4编辑  收藏  举报