Jump to content
Skullcode

Form border Style bsNone Covers taskbar

Recommended Posts

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

Try this, I am using this for maximize, working good

MainForm.SetBounds(Screen.WorkAreaRect);

 

Share this post


Link to post
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 by Remy Lebeau

Share this post


Link to post
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 by Remy Lebeau

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×