Change the param style, according to this MSDN blog:
http://blogs.msdn.com/b/oldnewthing/archive/2005/05/05/414910.aspx
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
inherited;
Params.Style := WS_POPUP or WS_VISIBLE; //will overlay taskbar
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Self.WindowState := wsMaximized; //fullscreen
end;
====================================
Full code to switch from Windowed to fullscreen mode and back (tested on Win7 64bit, Aero)
(Edit: works in Windows XP (vmware) too)
var
_OrgWindowedStyle: DWORD;
procedure TForm6.btnWindowedClick(Sender: TObject);
begin
Self.WindowState := wsNormal;
//set original style
SetWindowLong( Application.Handle, GWL_STYLE,
_OrgWindowedStyle);
//re-create window, to use changed style
RecreateWnd;
end;
procedure TForm6.btnFullScreenClick(Sender: TObject);
begin
_OrgWindowedStyle := 0; //clear: re-applies fullscreen mode in CreateParams
Self.WindowState := wsMaximized;
//re-create window, to use changed style
RecreateWnd;
end;
procedure TForm6.CreateParams(var Params: TCreateParams);
begin
inherited;
//first time? default fullscreen
if _OrgWindowedStyle = 0 then
begin
_OrgWindowedStyle := Params.Style;
Params.Style := //WS_POPUP or //not needed?
WS_VISIBLE
or WS_BORDER or WS_CAPTION //comment this line to remove border + titlebar
end;
end;
procedure TForm6.FormCreate(Sender: TObject);
begin
Self.WindowState := wsMaximized; //default fullscreen
end;