Detailed Description

Expand control (MC_WC_EXPAND).

The expand control is a utility control used to toggle size of another window between "collapsed" and "expanded" states.

In addition, when collapsing, the control automatically disables and hides all child windows of the managed window which fall out of the visible area; and when expanding it enables and shows all the child windows revealed by the resize operation. Application can disable this behavior with the style MC_EXS_IGNORECHILDREN.

Window

By default the managed window is a parent window of the control. Use message CCM_SETNOTIFYWINDOW to change what window the control manages.

Note

The root control also gets all the notifications from the control.

and Collapsed Sizes

If both width and height the of the expanded and/or collapsed sizes is zero, the control computes automatically from analyzes of position and size of all child windows of the managed window (usually the parent).

The width of the managed window is kept unchanged in this automatic regime. The height of the managed window is calculated so that all child windows of the managed window are visible (the expanded state) or all child windows positioned below the expand control itself are hidden (the collapsed state).

If you use style MC_EXS_CACHESIZES, the computed sizes are retained for next use, i.e. the sizes are computed only once.

State

After creation of the control, its logical state is collapsed. Though the control does not resize the dialog because it may not be already fully initialized, e.g. if the expand control is not last control created in the dialog.

Therefore it is supposed that application explicitly sends the message MC_EXM_EXPAND after the dialog and all its children are created, usually as part of the WM_INITDIALOG handling.

Fired when the control begins expansing or collapsing the parent window.

When application receives the message, the control is logically already in the desired style, so it can ask about it using MC_EXM_ISEXPANDED.

However the size of the parent window may be different from the desired state if the control animates it, as that takes some time. When the parent resizing is also finished, the application will receive notification MC_EXN_EXPANDED.