Maximizing form - problem lazarus / 31-LCL ---------------------------------------------------------------------- J-23 · 2019-12-07 16:18 Hi, I have form: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i object Form1: TForm1  Left = 383  Height = 240  Top = 250  Width = 320  BorderIcons = [biSystemMenu]  Caption = 'Form1'  ClientHeight = 240  ClientWidth = 320  WindowState = wsMaximized  object StatusBar1: TStatusBar    Left = 0    Height = 20    Top = 220    Width = 320    Panels = <>  endend                     The form at the start is maximized and only has a close button and StatusBar However, the form is maximized in a bad way. StatusBar cannot be seen. I suspect that this is an error that is described in the commentary in the procedure: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i class procedure TWin32WSCustomForm.ShowHide(const AWinControl: TWinControl);const  WindowStateToFlags: array[TWindowState] of DWord = ( { wsNormal     } SW_SHOWNORMAL, // to restore from minimzed/maximized we need to use SW_SHOWNORMAL instead of SW_SHOW { wsMinimized  } SW_SHOWMINIMIZED, { wsMaximized  } SW_SHOWMAXIMIZED, { wsFullScreen } SW_SHOWNORMAL  // win32 has no fullscreen window state  );var  Flags: DWord;begin  if AWinControl.HandleObjectShouldBeVisible then  begin    Flags := WindowStateToFlags[TCustomForm(AWinControl).WindowState];    Windows.ShowWindow(AWinControl.Handle, Flags);    { ShowWindow does not send WM_SHOWWINDOW when creating overlapped maximized window }    { TODO: multiple WM_SHOWWINDOW when maximizing after initial show? }  if Flags = SW_SHOWMAXIMIZED then      Windows.SendMessage(AWinControl.Handle, WM_SHOWWINDOW, 1, 0);  end  else  if fsModal in TCustomForm(AWinControl).FormState then    Windows.SetWindowPos(AWinControl.Handle, 0, 0, 0, 0, 0,      SWP_NOSIZE or SWP_NOMOVE or SWP_NOZORDER or SWP_NOACTIVATE or SWP_HIDEWINDOW)  else    Windows.ShowWindow(AWinControl.Handle, SW_HIDE);end;  I will gladly correct this error and publish a solution for the Lazarus community just wondering if there is LCL documentation for programmers or if I only have to analyze the code. ---------------------------------------------------------------------- winni · 2019-12-07 16:41 Hi! What do you mean - "Cannot be seen"? Is it hidden by the taskbar? Is it out of screen? Is it not visible anymore? Please describe the problem exact. Winni ---------------------------------------------------------------------- wp · 2019-12-07 17:48 I can reproduce the issue (Win 10, Laz trunk, fpc 3.0.4) for a form with initial WindowState = wsMaximized, but only when the bsMaximize style is removed from the BorderIcons: the statusbar is covered by the TaskBar of the desktop. However, Delphi has the same behavior, therefore I think the issue has its origin in Windows. You can prevent the statusbar of the maximized form being covered by the TaskBar when you switch the FormStyle to fsStayOnTop. ---------------------------------------------------------------------- winni · 2019-12-07 17:54 Hi! If it is the problem descibed by @wp then I recommend the tasbar settings of window: automatic hide taskbar. That solves all these problems. Winni ---------------------------------------------------------------------- J-23 · 2019-12-07 18:57 Quote from: winni on December 07, 2019, 05:41:05 pmHi! What do you mean - "Cannot be seen"? Is it hidden by the taskbar? Is it out of screen? Is it not visible anymore? Please describe the problem exact. Winni hi, The point is in the first screenshot you have the window displayed correctly, but with the maximize and minimize button. After disabling these two buttons. (BorderIcons = [biSystemMenu]) we have an image that looks like the second screenshot. Which seems to be invalid. Post WP describes that similar operation is in Delphi so it may actually be a problem on the Win32 side. ---------------------------------------------------------------------- ASerge · 2019-12-07 19:05 Use default BorderIcons and add code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FormActivate(Sender: TObject);begin  BorderIcons := [biSystemMenu];end; ---------------------------------------------------------------------- jamie · 2019-12-07 21:44 if you do this it may cause issues because there are apps that take the whole screen and then have the task bar drop down so the app becomes the whole screen.   I also remember a windows state that is in the TCustomForm but not supported natively in windows. Maybe the two of them are getting mixed up? ---------------------------------------------------------------------- J-23 · 2019-12-07 23:04 Quote from: ASerge on December 07, 2019, 08:05:30 pmUse default BorderIcons and add code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FormActivate(Sender: TObject);begin  BorderIcons := [biSystemMenu];end; This solution seems sufficient. Thank you ---------------------------------------------------------------------- J-23 · 2019-12-07 23:09 Quote from: jamie on December 07, 2019, 10:44:41 pmif you do this it may cause issues because there are apps that take the whole screen and then have the task bar drop down so the app becomes the whole screen.   I also remember a windows state that is in the TCustomForm but not supported natively in windows. Maybe the two of them are getting mixed up? The case you describe should be solved by the option (WindowState = wsFullScreen)