Function situarabajo (ByVal nombreformulario As String) As Integer
'MODIFICADA PARA SITUAR EN LA PARTE Inferior POR JOSE ACILU.
' -----------------------------------------------------------------------
Const POPUP = "OFormPopup"
Dim WindowHandle As Integer, DesktopHandle As Integer
Dim Buffer As String * 255
Dim CLASSNAME As String, FormRectangle As rectangulo, DesktopRectangle As rectangulo
Dim ReturnValue As Integer, FormHeight As Integer, FormWidth As Integer
Dim DesktopWidth As Integer, DesktopHeight As Integer
Dim x As Integer, y As Integer
ReturnValue = 0
On Error Resume Next
If nombreformulario = "" Then
WindowHandle = Screen.ActiveForm.hWnd
Else
WindowHandle = Forms(nombreformulario).hWnd
End If
If Err Then
Else
DesktopHandle = GetParent(WindowHandle)
ReturnValue = GetClassName(WindowHandle, Buffer, Len(Buffer))
CLASSNAME = Left$(Buffer, ReturnValue)
GetWindowRect WindowHandle, FormRectangle
If CLASSNAME = POPUP Then
GetWindowRect DesktopHandle, DesktopRectangle
Else
ReturnValue = GetClientRect(DesktopHandle, DesktopRectangle)
End If
FormWidth = FormRectangle.Right - FormRectangle.Left
FormHeight = FormRectangle.Bottom - FormRectangle.Top
DesktopWidth = DesktopRectangle.Right - DesktopRectangle.Left
DesktopHeight = DesktopRectangle.Bottom - DesktopRectangle.Top
If CLASSNAME = POPUP Then
x = DesktopRectangle.Left + (DesktopWidth - FormWidth) \ 2
y = DesktopRectangle.Top + (DesktopHeight - FormHeight)
Else
x = (DesktopWidth - FormWidth) \ 2
y = (DesktopHeight - FormHeight)
End If
ReturnValue = MoveWindow(WindowHandle, x, y, FormWidth, FormHeight, True)
End If