Author: Jonas Bilinkevicius
How do I set my form to display in full screen? No title bar, no borders, and it
goes over the task bar (not by setting the task bar to "Auto Hide").
Answer:
Emulating full screen mode:
private {in form declaration}
1 2 procedure WMGetMinMaxInfo(var msg: TWMGetMinMaxInfo); message WM_GETMINMAXINFO;
3 4 procedure TForm1.WMGetMinMaxInfo(var msg: TWMGetMinMaxInfo);
5 begin6 inherited;
7 with msg.MinMaxInfo^.ptMaxTrackSize do8 begin9 X := GetDeviceCaps(Canvas.handle, HORZRES) + (Width - ClientWidth);
10 Y := GetDeviceCaps(Canvas.handle, VERTRES) + (Height - ClientHeight);
11 end;
12 end;
13 14 procedure TForm1.Button2Click(Sender: TObject);
15 const16 Rect: TRect = (Left: 0; Top: 0; Right: 0; Bottom: 0);
17 FullScreen: Boolean = False;
18 begin19 FullScreen := not FullScreen;
20 if FullScreen then21 begin22 Rect := BoundsRect;
23 SetBounds(Left - ClientOrigin.X, Top - ClientOrigin.Y,
24 GetDeviceCaps(Canvas.handle, HORZRES)
25 + (Width - ClientWidth), GetDeviceCaps(Canvas.handle, VERTRES) + (Height -
26 ClientHeight));
27 {Label2.caption := IntToStr(GetDeviceCaps( Canvas.handle, VERTRES ));}28 end29 else30 BoundsRect := Rect;
31 end;