From: Boris Pauljev on
Does anybody know why the following happens?

->

I create a new desktop, switch to it and load my main form.
The form is shown in a maximized state (set by the properties editor at
design time).
The strange thing is that the form is displayed as if there was a
taskbar... It stops about 20 pixels over the bottom.

Normalizing and maximizing it again does not change anything... the form
is always displayed as if there was a taskbar.

A form without a border does not have this problem.

Does anybody know why this might be happening?
Wild ideas welcome, I already spent about 2 days on this subject.

Any help would be great.
Thank you.
From: Patrice on
Hello,

> The strange thing is that the form is displayed as if there was a
> taskbar... It stops about 20 pixels over the bottom.

My first thought would be to use :
http://support.microsoft.com/kb/154823/en-us
to check what is the space reserved for the desktop.

But IMO you are right the space for a taskbar is reserved. Not sure how you
create your desktop but either you can ask for no reservation or you can use
a similar API Call with SPI_SETWORKAREA to suppress this reservation...

--
Patrice

From: Mike Williams on
"Boris Pauljev" <nordiccoder(a)hotmail.com> wrote in message
news:%23jgmoLk3KHA.5084(a)TK2MSFTNGP02.phx.gbl...

> I create a new desktop, switch to it and load my main form.
> The form is shown in a maximized state (set by the properties
> editor at design time). The strange thing is that the form is
> displayed as if there was a taskbar... It stops about 20 pixels
> over the bottom. Normalizing and maximizing it again does not
> change anything... the form is always displayed as if there
> was a taskbar.

This works . .

Mike

Option Explicit
Private Declare Function SystemParametersInfo Lib "user32" _
Alias "SystemParametersInfoA" (ByVal uAction As Long, _
ByVal uParam As Long, lpvParam As Any, _
ByVal fuWinIni As Long) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Const SPI_GETWORKAREA = 48
Private Const SPI_SETWORKAREA = 47
Private OldArea As RECT, NewArea As RECT

Private Sub Form_Load()
SystemParametersInfo SPI_GETWORKAREA, vbNull, OldArea, 0&
NewArea.Top = 0: NewArea.Left = 0
NewArea.Bottom = ScaleY(Screen.Height, vbTwips, vbPixels)
NewArea.Right = ScaleX(Screen.Width, vbTwips, vbPixels)
SystemParametersInfo SPI_SETWORKAREA, vbNull, NewArea, 0&
Me.WindowState = vbMaximized
End Sub

Private Sub Form_Unload(Cancel As Integer)
SystemParametersInfo SPI_SETWORKAREA, vbNull, OldArea, 0&
End Sub



From: Boris Pauljev on
Mike, thanks a lot!! Yes, it helped.