This message is used to change the parent of a record in the container control. The fields of the TREEMOVE structure describe the record to be moved, the record to become its new parent, and where to insert the record relative to other records with the same parent.

If the preccNewParent field of the TREEMOVE structure is NULL, the record being moved is moved to the root level; otherwise, it is moved to preccNewParent. The pRecordOrder field of the TREEMOVE structure determines where the record being moved is placed relative to other records with the same parent (the one specified by preccNewParent). If flMoveSiblings of the TREEMOVE structure is TRUE, all siblings that follow the record being moved (preccMove) are moved to the new parent as well. Siblings that precede preccMove are not moved regardless of the value of the flMoveSiblings field. For normal Tree Move operations, the flMoveSiblings field of the TREEMOVE structure should be set to FALSE.

WinGetLastError returns PMERR_INVALID_PARAMETERS if any of the following illegal combinations are used:

For example, the following tree contains two parents, each with three children:

    Parent A    ³
    ÃÄÄÄÄÄÄÄÄÄÄChild A1
    ³
    ÃÄÄÄÄÄÄÄÄÄÄChild A2
    ³
    ÃÄÄÄÄÄÄÄÄÄÄChild A3
    ³
    Parent B
    ³
    ÃÄÄÄÄÄÄÄÄÄÄChild B1
    ³
    ÃÄÄÄÄÄÄÄÄÄÄChild B2
    ³
    ÃÄÄÄÄÄÄÄÄÄÄChild B3

If preccMove is Child A2, preccNewParent is Parent B, pRecordOrder = CMA_LAST and flMoveSiblings = TRUE, after the Tree Move operation, the new tree structure is as follows:
    Parent A
    ³
    ÃÄÄÄÄÄÄÄÄÄÄChild A1
    ³
    Parent B
    ³
    ÃÄÄÄÄÄÄÄÄÄÄChild B1
    ³
    ÃÄÄÄÄÄÄÄÄÄÄChild B2
    ³
    ÃÄÄÄÄÄÄÄÄÄÄChild B3
    ³
    ÃÄÄÄÄÄÄÄÄÄÄChild A2
    ³
    ÃÄÄÄÄÄÄÄÄÄÄChild A3


[Back] [Next]