Class

# DesktopMDIWindow

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Used to configure the MDI window on Multiple Document Interface applications. Specify the Multiple Document Interface option in the Properties pane for the `App</api/language/app>` class.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                            | Type                                        | Read-Only | Shared |
|-------------------------------------------------|---------------------------------------------|-----------|--------|
| `Handle<desktopmdiwindow.handle>`               | `Ptr</api/data_types/additional_types/ptr>` | ✓         |        |
| `Height<desktopmdiwindow.height>`               | `Integer</api/data_types/integer>`          |           |        |
| `Left<desktopmdiwindow.left>`                   | `Integer</api/data_types/integer>`          |           |        |
| `MaximumHeight<desktopmdiwindow.maximumheight>` | `Integer</api/data_types/integer>`          |           |        |
| `MaximumWidth<desktopmdiwindow.maximumwidth>`   | `Integer</api/data_types/integer>`          |           |        |
| `MinimumHeight<desktopmdiwindow.minimumheight>` | `Integer</api/data_types/integer>`          |           |        |
| `MinimumWidth<desktopmdiwindow.minimumwidth>`   | `Integer</api/data_types/integer>`          |           |        |
| `Title<desktopmdiwindow.title>`                 | `String</api/data_types/string>`            |           |        |
| `Top<desktopmdiwindow.top>`                     | `Integer</api/data_types/integer>`          |           |        |
| `Visible<desktopmdiwindow.visible>`             | `Boolean</api/data_types/boolean>`          |           |        |
| `Width<desktopmdiwindow.width>`                 | `Integer</api/data_types/integer>`          |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                       | Parameters | Returns | Shared |
|--------------------------------------------|------------|---------|--------|
| `Maximize<desktopmdiwindow.maximize>`      |            |         |        |
| `Minimize<desktopmdiwindow.minimize>`      |            |         |        |
| `Restore<desktopmdiwindow.restore_method>` |            |         |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                      | Parameters | Returns |
|-------------------------------------------|------------|---------|
| `Maximized<desktopmdiwindow.maximized>`   |            |         |
| `Minimized<desktopmdiwindow.minimized>`   |            |         |
| `Moved<desktopmdiwindow.moved>`           |            |         |
| `Opening<desktopmdiwindow.opening>`       |            |         |
| `Resized<desktopmdiwindow.resized>`       |            |         |
| `Restore<desktopmdiwindow.restore_event>` |            |         |

## Property descriptions

<div id="desktopmdiwindow.handle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Handle

**Handle** As `Ptr</api/data_types/additional_types/ptr>`

> Returns a handle to the MDI window. Any visible Win32 control should have a handle.
>
> This property is read-only.

<div id="desktopmdiwindow.height">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Height

**Height** As `Integer</api/data_types/integer>`

> The height of the MDI window.
>
> This example sets several properties of the <span class="title-ref">DesktopMDIWindow</span>. It is in the Opening event of the App.
>
> ``` xojo
> App.MDIWindow.Height = 300
> App.MDIWindow.Width = 450
> App.MDIWindow.Left = 15
> App.MDIWindow.Top = 10
> App.MDIWindow.Title = "MDIWindow Title"
> App.MDIWindow.MinimumWidth = 250
> App.MDIWindow.MinimumHeight = 100
> App.MDIWindow.MaximumHeight = 400
> App.MDIWindow.MaximumWidth = 600
> App.MDIWindow.Visible = True
> ```

<div id="desktopmdiwindow.left">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Left

**Left** As `Integer</api/data_types/integer>`

> The distance (in pixels) between the left edge of the screen and the left edge of the MDI window.
>
> This example sets several properties of the <span class="title-ref">DesktopMDIWindow</span>. It is in the Opening event of the App.
>
> ``` xojo
> App.MDIWindow.Height = 300
> App.MDIWindow.Width = 450
> App.MDIWindow.Left = 15
> App.MDIWindow.Top = 10
> App.MDIWindow.Title = "MDIWindow Title"
> App.MDIWindow.MinimumWidth = 250
> App.MDIWindow.MinimumHeight = 100
> App.MDIWindow.MaximumHeight = 400
> App.MDIWindow.MaximumWidth = 600
> App.MDIWindow.Visible = True
> ```

<div id="desktopmdiwindow.MaximumHeight">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.MaximumHeight

**MaximumHeight** As `Integer</api/data_types/integer>`

> The maximum height to which the MDI window can be resized.
>
> This example sets several properties of the <span class="title-ref">DesktopMDIWindow</span>. It is in the Opening event of the App.
>
> ``` xojo
> App.MDIWindow.Height = 300
> App.MDIWindow.Width = 450
> App.MDIWindow.Left = 15
> App.MDIWindow.Top = 10
> App.MDIWindow.Title = "MDIWindow Title"
> App.MDIWindow.MinimumWidth = 250
> App.MDIWindow.MinimumHeight = 100
> App.MDIWindow.MaximumHeight = 400
> App.MDIWindow.MaximumWidth = 600
> App.MDIWindow.Visible = True
> ```

<div id="desktopmdiwindow.MaximumWidth">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.MaximumWidth

**MaximumWidth** As `Integer</api/data_types/integer>`

> The maximum width to which the MDI window can be resized.
>
> This example sets several properties of the <span class="title-ref">DesktopMDIWindow</span>. It is in the Opening event of the App.
>
> ``` xojo
> App.MDIWindow.Height = 300
> App.MDIWindow.Width = 450
> App.MDIWindow.Left = 15
> App.MDIWindow.Top = 10
> App.MDIWindow.Title = "MDIWindow Title"
> App.MDIWindow.MinimumWidth = 250
> App.MDIWindow.MinimumHeight = 100
> App.MDIWindow.MaximumHeight = 400
> App.MDIWindow.MaximumWidth = 600
> App.MDIWindow.Visible = True
> ```

<div id="desktopmdiwindow.MinimumHeight">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.MinimumHeight

**MinimumHeight** As `Integer</api/data_types/integer>`

> The minimum height to which the MDI window can be resized.
>
> This example sets several properties of the <span class="title-ref">DesktopMDIWindow</span>. It is in the Opening event of the App.
>
> ``` xojo
> App.MDIWindow.Height = 300
> App.MDIWindow.Width = 450
> App.MDIWindow.Left = 15
> App.MDIWindow.Top = 10
> App.MDIWindow.Title = "MDIWindow Title"
> App.MDIWindow.MinimumWidth = 250
> App.MDIWindow.MinimumHeight = 100
> App.MDIWindow.MaximumHeight = 400
> App.MDIWindow.MaximumWidth = 600
> App.MDIWindow.Visible = True
> ```

<div id="desktopmdiwindow.MinimumWidth">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.MinimumWidth

**MinimumWidth** As `Integer</api/data_types/integer>`

> The minimum width to which the MDI window can be resized.
>
> This example sets several properties of the <span class="title-ref">DesktopMDIWindow</span>. It is in the Opening event of the App.
>
> ``` xojo
> App.MDIWindow.Height = 300
> App.MDIWindow.Width = 450
> App.MDIWindow.Left = 15
> App.MDIWindow.Top = 10
> App.MDIWindow.Title = "MDIWindow Title"
> App.MDIWindow.MinimumWidth = 250
> App.MDIWindow.MinimumHeight = 100
> App.MDIWindow.MaximumHeight = 400
> App.MDIWindow.MaximumWidth = 600
> App.MDIWindow.Visible = True
> ```

<div id="desktopmdiwindow.title">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Title

**Title** As `String</api/data_types/string>`

> The MDI window title.
>
> This example sets several properties of the <span class="title-ref">DesktopMDIWindow</span>. It is in the Opening event of the App.
>
> ``` xojo
> App.MDIWindow.Height = 300
> App.MDIWindow.Width = 450
> App.MDIWindow.Left = 15
> App.MDIWindow.Top = 10
> App.MDIWindow.Title = "MDIWindow Title"
> App.MDIWindow.MinimumWidth = 250
> App.MDIWindow.MinimumHeight = 100
> App.MDIWindow.MaximumHeight = 400
> App.MDIWindow.MaximumWidth = 600
> App.MDIWindow.Visible = True
> ```

<div id="desktopmdiwindow.top">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Top

**Top** As `Integer</api/data_types/integer>`

> The distance (in pixels) between the top edge of the screen and the top edge of the MDI window.
>
> This example sets several properties of the <span class="title-ref">DesktopMDIWindow</span>. It is in the Opening event of the App.
>
> ``` xojo
> App.MDIWindow.Height = 300
> App.MDIWindow.Width = 450
> App.MDIWindow.Left = 15
> App.MDIWindow.Top = 10
> App.MDIWindow.Title = "MDIWindow Title"
> App.MDIWindow.MinimumWidth = 250
> App.MDIWindow.MinimumHeight = 100
> App.MDIWindow.MaximumHeight = 400
> App.MDIWindow.MaximumWidth = 600
> App.MDIWindow.Visible = True
> ```

<div id="desktopmdiwindow.visible">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Visible

**Visible** As `Boolean</api/data_types/boolean>`

> If `True</api/language/true>`, the MDI window will be visible when it is opened.
>
> This example sets several properties of the <span class="title-ref">DesktopMDIWindow</span>. It is in the Opening event of the App.
>
> ``` xojo
> App.MDIWindow.Height = 300
> App.MDIWindow.Width = 450
> App.MDIWindow.Left = 15
> App.MDIWindow.Top = 10
> App.MDIWindow.Title = "MDIWindow Title"
> App.MDIWindow.MinimumWidth = 250
> App.MDIWindow.MinimumHeight = 100
> App.MDIWindow.MaximumHeight = 400
> App.MDIWindow.MaximumWidth = 600
> App.MDIWindow.Visible = True
> ```

<div id="desktopmdiwindow.width">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Width

**Width** As `Integer</api/data_types/integer>`

> The width of the MDI window.
>
> This example sets several properties of the <span class="title-ref">DesktopMDIWindow</span>. It is in the Opening event of the App.
>
> ``` xojo
> App.MDIWindow.Height = 300
> App.MDIWindow.Width = 450
> App.MDIWindow.Left = 15
> App.MDIWindow.Top = 10
> App.MDIWindow.Title = "MDIWindow Title"
> App.MDIWindow.MinimumWidth = 250
> App.MDIWindow.MinimumHeight = 100
> App.MDIWindow.MaximumHeight = 400
> App.MDIWindow.MaximumWidth = 600
> App.MDIWindow.Visible = True
> ```

## Method descriptions

<div id="desktopmdiwindow.maximize">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Maximize

**Maximize**

> Maximizes the MDI window.
>
> This example maximizes the MDI window.
>
> ``` xojo
> App.MDIWindow.Maximize
> ```

<div id="desktopmdiwindow.minimize">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Minimize

**Minimize**

> Minimizes the MDI window.
>
> This example minimizes the MDI window.
>
> ``` xojo
> App.MDIWindow.Minimize
> ```

<div id="desktopmdiwindow.restore_method">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Restore

**Restore**

> Restores the MDI window.

## Event descriptions

<div id="desktopmdiwindow.maximized">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Maximized

**Maximized**

> Occurs when the MDI window maximized.

<div id="desktopmdiwindow.minimized">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Minimized

**Minimized**

> Occurs when the MDI window minimized.

<div id="desktopmdiwindow.moved">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Moved

**Moved**

> Occurs when the MDI window moves.

<div id="desktopmdiwindow.opening">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Opening

**Opening**

> Occurs when the MDI window is created.

<div id="desktopmdiwindow.resized">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Resized

**Resized**

> Occurs when the MDI window resizes.

<div id="desktopmdiwindow.restore_event">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopMDIWindow.Restore

**Restore**

> Occurs when the MDI window is restored to its former size.

## Notes

You have the option of using the Multiple Document Interface (MDI) for the Windows build of your application. If you select this option, all of your application's windows will be enclosed in a "parent" window called the MDI window. If you don't select the MDI interface, then your application will be a Single Document Interface (SDI) application and your application's windows will be directly on the desktop (since there is no MDI window). This class allows you to set certain properties and behaviors of the MDI window.

You can set the <span class="title-ref">DesktopMDIWindow</span> property of the `App</api/user_interface/desktop/desktopapplication>` class to a new instance of an <span class="title-ref">DesktopMDIWindow</span> subclass. Use this technique to implement the events for an <span class="title-ref">DesktopMDIWindow</span>.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

### Getting the handle of a child window

There are two handles that a `Declare</api/language/declare>` writer may need when it comes to MDIWindows. The Handle property returns the frame window's handle. If you want the MDICLIENT handle for doing things like cascading child windows, then you need to get the child window based on the Handle with a code snippet like this:

``` xojo
Module MDIWindowExtensions

  Private Var mClientHandle As Ptr

  Function MDIClientHandle(Extends w As DesktopMDIWindow) As Ptr
    ' There's two different handles used for an MDI window. The frame
    ' handle (which is DesktopMDIWindow.Handle), and the client handle. This
    ' gets the client handle, which is used for things like tiling or cascading
    ' child windows.

    If mClientHandle <> Nil Then Return mClientHandle

    #If TargetWindows

      Declare Sub EnumChildWindows Lib "User32" (parent As Ptr, _
        proc As Ptr, lParam As Integer)
      mClientHandle = Nil
      ' Do the enumeration
      EnumChildWindows(w.Handle, AddressOf enumChildProc, 0)
      ' Return the client's handle
      Return mClientHandle

    #EndIf
  End Function

  Function EnumChildProc(hwnd As Ptr, lParam As Integer) As Boolean
    #If TargetWindows Then

      ' We need to figure out what class this window belongs to
      Soft Declare Function GetClassNameW Lib "User32" (hwnd As Ptr,_
        name As Ptr, count As Int32) As Int32
      Soft Declare Function GetClassNameA Lib "User32" (hwnd As Ptr, _
        name As Ptr, count As Int32) As Int32

      Var classNamePtr As New MemoryBlock(256)
      Var className As String

      If System.IsFunctionAvailable("GetClassNameW", "User32") Then

        Var cnt As Integer = GetClassNameW(hwnd, classNamePtr, classNamePtr.Size)
        className = classNamePtr.WString(0)

      Else

        Var cnt As Integer = GetClassNameA(hwnd, classNamePtr, classNamePtr.Size)
        className = classNamePtr.CString(0)

      End If

      ' If the name is MDICLIENT, then we're done
      If className = "MDICLIENT" Then

        mClientHandle = hwnd
        Return False

      End If

      Return True

    #EndIf
  End Function
End Module
```

## Sample code

This example sets several properties of the <span class="title-ref">DesktopMDIWindow</span>. It is in the Opening event of the App.

``` xojo
App.MDIWindow.Height = 300
App.MDIWindow.Width = 450
App.MDIWindow.Left = 15
App.MDIWindow.Top = 10
App.MDIWindow.Title = "MDIWindow Title"
App.MDIWindow.MinimumWidth = 250
App.MDIWindow.MinimumHeight = 100
App.MDIWindow.MaximumHeight = 400
App.MDIWindow.MaximumWidth = 600
App.MDIWindow.Visible = True
```

## Compatibility

|                       |         |
|-----------------------|---------|
| **Project Types**     | Desktop |
| **Operating Systems** | All     |

<div class="seealso">

`Object</api/data_types/additional_types/object>` parent class; `DesktopApplication</api/user_interface/desktop/desktopapplication>` class; `App</api/language/app>` object.

</div>
