To destroy a control, use the DestroyWindow function. This function deletes any internal record of the control and removes the control from the parent window's client area. The following example shows how to destroy a control:
DestroyWindow(hEditWnd);
Windows automatically destroys a control when it destroys the parent window. In general, you will need to destroy a control only if you no longer need it in the parent window.