Using MoveWindow() to Move an Iconic MDI Child and Its Title

ID Number: Q70079

3.00

WINDOWS

Summary:

Although Windows version 3.00 does not have API calls to support

dragging iconic windows (windows represented by an icon), calls to

MoveWindow() can be used to implement a dragging functionality for

iconic multiple-document interface (MDI) child windows.

However, the icon's title is not in the same window as the icon, so

when the icon is moved, the title will not automatically move with it.

The title is in a small window of its own, so a separate call to

MoveWindow() must be made to place the title window correctly below

the icon.

The information below describes how to get the window handle for the

small title window, so that the appropriate call to MoveWindow() can

be made.

This information applies to applications created with the Windows

Software Development Kit (SDK) version 3.00.

More Information:

The icon's title window is a window of class #32722. This window is a

child of the MDI client window, and its owner is the icon window.

To get the window handle to the appropriate icon title window for a

given icon, enumerate all the children of the MDI client window,

looking for a window whose owner is the icon.

You can use EnumChildWindows() to loop through all the children of the

MDI client window.

You can use GetWindow(..., GW_OWNER) to check the parent of each

window.