MirceaVleju
Programmer
Can anyone tell me how can i run a program in fullscreen mode?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
procedure TForm1.FormCreate(Sender: TObject);
begin
BoundsRect := Screen.DesktopRect
end;
// Test all screen ressolutions to see if the desired res can be obtained
// Colours is the desired colour depth in Bits.
function CanDisplayAt(Width, Height, Colours: Cardinal): boolean;
var i: integer;
devmode: TDevMode;
begin
i := 0;
Result := false;
while enumdisplaysettings(nil,i,devmode) do
begin
with devmode do
if (dmpelswidth = Width) and (dmpelsheight = Height) and (dmbitsperpel = Colours) then
begin
result := True;
exit;
end;
inc(i);
end;
end;
// Colours is the desired colour depth in Bits.
function ChangeResolution(Width, Height, Colours: Cardinal): boolean;
var ScreenData: TDevMode;
begin
if EnumDisplaySettings(nil, 1, ScreenData) then
begin
with screendata do
begin
dmPelsWidth := Width;
dmPelsHeight := Height;
dmBitsPerPel := Colours;
dmFields := dmFields or DM_PELSWIDTH;
dmFields := dmFields or DM_PELSHEIGHT;
dmfields:= dmFields or DM_BITSPERPEL;
end;
end;
if ChangeDisplaySettings(ScreenData, 0) = DISP_CHANGE_SUCCESSFUL then
result := true
else
result := false;
// SendMessage(HWND_BROADCAST,WM_DISPLAYCHANGE,SPI_SETNONCLIENTMETRICS,0);
end;