The SmsCloseContainer function closes an open container.
SMS_STATUS SmsCloseContainer(
HANDLE hContainer // Handle to container.
);
The SmsCloseContainer function returns a status code SMS_STATUS. If successful, the function returns a status of SMS_OK. Otherwise, it returns the following manifest constant:
When your application closes a container, any open folders within the container are not closed automatically. Your application must explicitly close folders that have been opened using SmsCreateFolder, SmsGetNextFolder, or SmsGetFolderByID. Therefore, you can open a container's folders, close the container, and still have access to the folders.
SmsCreateFolder, SmsGetNextFolder, SmsGetFolderByID