也可以使用Api函数。
试试下面这一段代码,也许有收获的。procedure TForm1.CheckBox1Click(Sender: TObject);
var
WindowStyle: Longint; // holds the window style
begin
{get the current styles used by this window}
WindowStyle:=GetWindowLong(Form1.Handle, GWL_STYLE); {toggle the WS_CAPTION style}
if (CheckBox1.Checked) then
WindowStyle:=WindowStyle OR WS_CAPTION
else
WindowStyle:=WindowStyle AND NOT WS_CAPTION; {toggle the WS_BORDER style}
if (CheckBox2.Checked) then
WindowStyle:=WindowStyle OR WS_BORDER
else
WindowStyle:=WindowStyle AND NOT WS_BORDER; {toggle the WS_SYSMENU style}
if (CheckBox3.Checked) then
WindowStyle:=WindowStyle OR WS_SYSMENU
else
WindowStyle:=WindowStyle AND NOT WS_SYSMENU; {toggle the WS_MAXIMIZEBOX style} if (CheckBox4.Checked) then
WindowStyle:=WindowStyle OR WS_MAXIMIZEBOX
else
WindowStyle:=WindowStyle AND NOT WS_MAXIMIZEBOX; {toggle the WS_MINIMIZEBOX style}
if (CheckBox5.Checked) then
WindowStyle:=WindowStyle OR WS_MINIMIZEBOX
else
WindowStyle:=WindowStyle AND NOT WS_MINIMIZEBOX;
{make the window use the new styles}
SetWindowLong(Form1.Handle, GWL_STYLE, WindowStyle); {this little trick forces the entire window to redraw,
including non-client areas}
SetWindowPos(Handle, 0, 0, 0, 0, 0, SWP_DRAWFRAME or SWP_NOACTIVATE or
SWP_NOMOVE or SWP_NOSIZE or SWP_NOZORDER); {display the current styles used by this window}
Label1.Caption:='Current Style: '+IntToStr(WindowStyle);
end;procedure TForm1.FormCreate(Sender: TObject);
var
WindowStyle: Longint; // holds the window style informationbegin
{get the current styles used by this window}
WindowStyle:=GetWindowLong(Form1.Handle, GWL_STYLE); {initialize the check boxes according to the styles that are present}
if (WindowStyle AND WS_CAPTION)>0 then CheckBox1.Checked:=TRUE;
if (WindowStyle AND WS_BORDER)>0 then CheckBox2.Checked:=TRUE;
if (WindowStyle AND WS_SYSMENU)>0 then CheckBox3.Checked:=TRUE;
if (WindowStyle AND WS_MAXIMIZEBOX)>0 then CheckBox4.Checked:=TRUE; if (WindowStyle AND WS_MINIMIZEBOX)>0 then CheckBox5.Checked:=TRUE; {hook up the OnClick events for the checkboxes. this step is necessary
because the OnClick event is automatically fired when the Checked
property is accessed.}
CheckBox1.OnClick:=CheckBox1Click;
CheckBox2.OnClick:=CheckBox1Click;
CheckBox3.OnClick:=CheckBox1Click;
CheckBox4.OnClick:=CheckBox1Click;
CheckBox5.OnClick:=CheckBox1Click;
end;The Tomes of Delphi 3: Win32 Core API Help File by Larry Diehl
试试下面这一段代码,也许有收获的。procedure TForm1.CheckBox1Click(Sender: TObject);
var
WindowStyle: Longint; // holds the window style
begin
{get the current styles used by this window}
WindowStyle:=GetWindowLong(Form1.Handle, GWL_STYLE); {toggle the WS_CAPTION style}
if (CheckBox1.Checked) then
WindowStyle:=WindowStyle OR WS_CAPTION
else
WindowStyle:=WindowStyle AND NOT WS_CAPTION; {toggle the WS_BORDER style}
if (CheckBox2.Checked) then
WindowStyle:=WindowStyle OR WS_BORDER
else
WindowStyle:=WindowStyle AND NOT WS_BORDER; {toggle the WS_SYSMENU style}
if (CheckBox3.Checked) then
WindowStyle:=WindowStyle OR WS_SYSMENU
else
WindowStyle:=WindowStyle AND NOT WS_SYSMENU; {toggle the WS_MAXIMIZEBOX style} if (CheckBox4.Checked) then
WindowStyle:=WindowStyle OR WS_MAXIMIZEBOX
else
WindowStyle:=WindowStyle AND NOT WS_MAXIMIZEBOX; {toggle the WS_MINIMIZEBOX style}
if (CheckBox5.Checked) then
WindowStyle:=WindowStyle OR WS_MINIMIZEBOX
else
WindowStyle:=WindowStyle AND NOT WS_MINIMIZEBOX;
{make the window use the new styles}
SetWindowLong(Form1.Handle, GWL_STYLE, WindowStyle); {this little trick forces the entire window to redraw,
including non-client areas}
SetWindowPos(Handle, 0, 0, 0, 0, 0, SWP_DRAWFRAME or SWP_NOACTIVATE or
SWP_NOMOVE or SWP_NOSIZE or SWP_NOZORDER); {display the current styles used by this window}
Label1.Caption:='Current Style: '+IntToStr(WindowStyle);
end;procedure TForm1.FormCreate(Sender: TObject);
var
WindowStyle: Longint; // holds the window style informationbegin
{get the current styles used by this window}
WindowStyle:=GetWindowLong(Form1.Handle, GWL_STYLE); {initialize the check boxes according to the styles that are present}
if (WindowStyle AND WS_CAPTION)>0 then CheckBox1.Checked:=TRUE;
if (WindowStyle AND WS_BORDER)>0 then CheckBox2.Checked:=TRUE;
if (WindowStyle AND WS_SYSMENU)>0 then CheckBox3.Checked:=TRUE;
if (WindowStyle AND WS_MAXIMIZEBOX)>0 then CheckBox4.Checked:=TRUE; if (WindowStyle AND WS_MINIMIZEBOX)>0 then CheckBox5.Checked:=TRUE; {hook up the OnClick events for the checkboxes. this step is necessary
because the OnClick event is automatically fired when the Checked
property is accessed.}
CheckBox1.OnClick:=CheckBox1Click;
CheckBox2.OnClick:=CheckBox1Click;
CheckBox3.OnClick:=CheckBox1Click;
CheckBox4.OnClick:=CheckBox1Click;
CheckBox5.OnClick:=CheckBox1Click;
end;The Tomes of Delphi 3: Win32 Core API Help File by Larry Diehl
bordericons下的
biminimize设成false;
bimaximize设成false;
bisystemmenu设成false;
在运行时, chechy(我爱洁洁)得就可以了
比如按Alt+F4照样可以关闭,在程序标题条上点右键仍然弹出菜单。如果想
彻底屏蔽请使用其他方法!