SetWindowLong(Handle,GWL_STYLE,GetWindowLong(Handle,GWL_STYLE)
and not WS_CAPTION);
看看下面这个程序,是否对你有帮助.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, AxCtrls, OleCtrls, VCF1, Chartfx3;
type
TForm1 = class(TForm)
Chartfx1: TChartfx;
procedure FormKeyDown(Sender: TObject;
var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
procedure WMSysCommand(var Msg: TWMSysCommand);message WM_SYSCOMMAND;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMSysCommand(var Msg: TWMSysCommand);
begin
if (Msg.CmdType=SC_MAXIMIZE) then
begin
SetWindowLong(Handle,GWL_STYLE,GetWindowLong(Handle,GWL_STYLE) and not WS_CAPTION);
self.WindowState:=wsMaximized;
end
else
DefaultHandler(Msg);
Application.ProcessMessages;
end;
procedure TForm1.FormKeyDown(Sender: TObject;
var Key: Word;
Shift: TShiftState);
begin
if Key=VK_ESCAPE then
begin
showmessage('Ok');
SetWindowLong(Handle,GWL_STYLE,GetWindowLong(Handle,GWL_STYLE) or WS_CAPTION);
WindowState:=wsNormal;
end;
end;
end.