CM REMOVERECORD
This message removes one, multiple, or all RECORDCORE structures from the container control.
- Note
- ; If the CCS_MINIRECORDCORE style bit is specified when a container is created, then MINIRECORDCORE should be used instead of RECORDCORE, and PMINIRECORDCORE should be used instead of PRECORDCORE in all applicable data structures and messages.
Syntax
param1 PVOID pRecordArray; /* Pointer to an array of pointers to RECORDCORE structures that are to be removed. */ param2 USHORT cNumRecord; /* Number of records. */ USHORT fRemoveRecord; /* Flags. */
Parameters
- pRecordArray (PVOID) - Input
- Pointer to an array of pointers to RECORDCORE structures that are to be removed.
- cNumRecord (USHORT) - Input
- Number of container records to be removed. If the cNumRecord parameter has a value of 0, all of the records in the container are removed and the pRecordArray parameter is ignored.
- fRemoveRecord (USHORT) - Input
- Flags that show whether memory must be freed and container records invalidated.
- CMA_FREE: If specified, RECORDCORE structures are removed and memory associated with the RECORDCORE structures is freed. If not specified, RECORDCORE structures are removed and no memory is freed; this is the default.
- CMA_INVALIDATE: If specified, after RECORDCORE structures are removed, the container is invalidated and any necessary repositioning of the container records is performed. If not specified, invalidation is not performed. This option is not valid in the icon view unless the CCS_AUTOPOSITION style bit is not set. In the icon view, the container record is refreshed if the CCS_AUTOPOSITION style bit is set, regardless of whether the CMA_INVALIDATE attribute is set.
Returns
- cRecords (LONG) - returns
- Number of structures.
- -1: An error occurred. The WinGetLastError function may return the following errors:
- PMERR_INVALID_PARAMETERS
- PMERR_MEMORY_DEALLOCATION_ERR
- Other: Number of root level RECORDCORE structures that remain in the container.
- -1: An error occurred. The WinGetLastError function may return the following errors:
Remarks
When parent item records are removed, all associated child item records are removed as well.
If the CMA_FREE attribute is not specified, the container control removes the specified RECORDCORE structures without freeing the memory. The application is responsible for freeing the memory associated with the RECORDCORE structure by using the CM_FREERECORD message.
If the cNumRecord parameter has a value of 0 and the CMA_FREE attribute is specified, all of the RECORDCORE structures in the container control are removed and the memory associated with the RECORDCORE structures is freed. It is the application's responsibility to free all of the application-allocated memory associated with the RECORDCORE structures.
If the number of pointers to RECORDCORE structures in the array exceeds the count of RECORDCORE structures to be removed, only the number of records specified in the cNumRecord parameter is removed. If the CCS_VERIFYPOINTERS style bit is set and the pRecordArray parameter contains pointers to a RECORDCORE structure or structures that do not exist, the PMERR_INVALID_PARAMETERS error is set.
If the CMA_INVALIDATE attribute is specified, the container is repainted if the removed record or records are visible.
Default Processing
The default window procedure does not expect to receive this message and therefore takes no action on it other than to return 0.