Skullcode 0 Posted September 14, 2020 i have a form with bsNone borderStyle when i execute WindowState := wsMaximized; the taskbar became totally covered how can i avoid that ? Share this post Link to post
enesgeven 6 Posted September 14, 2020 Try this, I am using this for maximize, working good MainForm.SetBounds(Screen.WorkAreaRect); Share this post Link to post
Remy Lebeau 1397 Posted September 14, 2020 (edited) 6 hours ago, enesgeven said: Try this, I am using this for maximize, working good MainForm.SetBounds(Screen.WorkAreaRect); Setting the Form's position+size that way is not quite the same thing as actually maximizing the window. That is two different states. If you really want to control the Form's size/position when maximized, have the Form handle the WM_GETMINMAXINFO message. You can use the Screen.WorkAreaRect to help you decide what bounds to set from there. Alternatively, try using the Screen.WorkAreaRest to help you set the Form's Contraints property as needed. Edited September 14, 2020 by Remy Lebeau Share this post Link to post
enesgeven 6 Posted September 14, 2020 Thanks @Remy Lebeau your solutions always pro. I am using this code on FMX (Topic is VCL, I saw now) Share this post Link to post
Remy Lebeau 1397 Posted September 14, 2020 (edited) 2 hours ago, enesgeven said: Thanks @Remy Lebeau your solutions always pro. I am using this code on FMX (Topic is VCL, I saw now) My answer applies to FMX as well as VCL, though the details of the implementation will differ between them. To handle the WM_GETMINMAXINFO message in VCL, you can simply override the Form's virtual WndProc() method, or subclass its WindowProc property, or use a message method directly on your Form's class type. But in FMX, those options are not available. There is no WndProc/WindowProc to override/subclass. And FMX dispatches only window messages that FMX itself uses internally. So, you would have to instead manually subclass the Form's HWND directly by using the Win32 SetWindowsLongPtr(GWL_WNDPROC) or SetWindowsSubclass() function. Edited September 14, 2020 by Remy Lebeau Share this post Link to post