Making game respect desktop taskbar and dimensions

Hi, I am making a game that I suspect most people will want to run in windows mode on the desktop rather than full screen. When in this mode the window fulls the whole screen and is the same size as the physical screen, so is either partially covered by the taskbar, or it’s own title bar gets pushed off the top of the screen.

Let’s say a player has a 1920x1080 screen, the taskbar takes up 30 pixels, the game opens a 1920x1080 window, and either part of it is covered by the taskbar, or the game window title bar is pushed off the top of the screen and cant be clicked. It is worse if the user has their taskbar in a different location like the side or top of their screen.

How can I make it start in a window, maximised to fill the available desktop space the way normal applications do in windows and adjust for the taskbar size and position?