CM ARRANGE
This message arranges the container records in the icon view of the container control.
Syntax
param1 ULONG ulArrangeType; /* Type of arrangement for icons or bitmaps. */ param2 ULONG ulArrangeFlags; /* Flags for arrangement type specified in ultype. */
Parameters
- ulArrangeType (ULONG) - Input
- Type of arrangement for icons or bitmaps.
- Specify one of the following arrangement types:
- CMA_ARRANGESTANDARD: Standard arrangement.
- Icons are arranged at the top of the window, starting at the upper left-hand corner. This value is set to zero to provide compatibility with existing applications.
- CMA_ARRANGEGRID: Grid arrangement.
- Icons are arranged in a grid of equal-size squares in the container window. The grid pattern can be defined as the perimeter, left, right, top, or bottom of the window. It also can be user-defined.
- CMA_ARRANGESELECTED: Selected arrangement.
- Currently selected icons are arranged horizontally or vertically in the container window.
- CMA_ARRANGESTANDARD: Standard arrangement.
- ulArrangeFlags (ULONG) - Input
- Flags for arrangement type specified in ultype.
-
- CMA_ARRANGESTANDARD: If the arrangement type is CMA_ARRANGESTANDARD, this value is NULL.
- CMA_ARRANGEGRID: If the arrangement type is CMA_ARRANGEGRID, specify one of the following arrangement patterns:
- CMA_PERIMETER: Icons are arranged along the top, left and right side of the window, leaving the middle unoccupied.
- CMA_LEFT: Icons are arranged starting at the upper left corner of the window and proceeding top-to-bottom, left-to-right.
- CMA_RIGHT: Icons are arranged starting at the upper right corner of the window, and proceeding top-to-bottom, right-to-left.
- CMA_TOP: Icons are arranged at the top of the window. The difference between this and the standard arrangement is that positioning is according to grid square size, not tile size. (An icon's tile size is the rectangle that encompasses both icon and text.)
- CMA_BOTTOM: Icons are arranged, starting at the lower left corner and proceeding left-to-right, bottom-to-top.
- CMA_USER: The application provides the user with a means of specifying which squares are to be occupied and which are not. The CM_SETGRIDINFO message marks each grid square as available or unavailable for an icon. The current grid information can be obtained at any time by using the CM_QUERYGRIDINFO message.
- CMA_ARRANGESELECTED: If the arrangement type is CMA_ARRANGESELECTED, specify one of the following orientations:
- CMA_HORIZONTAL: Orient selected icons horizontally.
- CMA_VERTICAL: Orient selected icons vertically.
- When the container receives a message indicating a selected arrangement is desired, it goes into "Selected Arrange" mode. The mouse is captured and the pointer changes to indicate the orientation of the arrangement selection in progress (horizontal or vertical). When the user presses mouse button 1 over an area in the container window, the icons are immediately positioned at that point, and the container ends the selected range mode and releases the mouse capture. If the current view is CV_ICON, the selected icons are arranged starting at the precise point where the user clicked the mouse. If the current view is CV_GRID, the selected icons are arranged starting at the grid square closest to the point where the user clicked the mouse.
Returns
- rc (BOOL) - returns
- Success indicator.
- TRUE: Icon/text or bit-map/text pairs were successfully arranged.
- FALSE: An error occurred.
Remarks
A vertical scroll bar is enabled, if necessary.
Before the relocation of the container items, the origin of the client area rectangle is reset to coincide with the origin of the container's workspace. Arranging the container items does not affect the record attributes.
If the CCS_AUTOPOSITION style bit is set, you do not need to send the CM_ARRANGE message, since this style bit causes the container control to arrange the container items for the application.
If the current view is not the icon view, no visible change occurs until the current view is switched to the icon view. For example, if the name view is the current view and the CM_ARRANGE message is sent, the display does not change.
The container updates the ptlIcon field of the RECORDCORE structure with the new coordinates.
Default Processing
The default window procedure does not expect to receive this message and therefore takes no action on it other than to return FALSE.