Because of the implementation of direct manipulation in OS/2, the snap-to-grid property requires cooperation from the application.

Items being dragged are represented by DRAGITEM structures. This structure contains the ulItemID field, which is available for application use. Applications usually use this field to identify the object being dragged. To provide flexibility to applications, the value in the field can vary from application to application. The most natural value for this field when dragging objects within a container would be the RECORDCORE pointer. However the field can also be a pointer to an application-defined structure that contains many fields (possibly including the RECORDCORE pointer).

Because ulItemID can have more than one interpretation, the container must be told which records are to be repositioned and where to begin the repositioning. An application can do this by iterating through the DRAGITEM structures (provided by the CN_DROP notification) and creating a linked list of container records to be repositioned or snapped to the grid. The point to begin the positioning from can be obtained directly from the DRAGINFO structure passed on the CN_DROP notification.

Grid squares that are marked partial (the CMA_PARTIAL bit is set in the ulState field of the GRIDSQUARE structure) can be used for the Snap-To-Grid property.

Note: This message returns FALSE if the current view is not CV_GRID.