8.3.5 Destroying a Control

To destroy a control, use the DestroyWindow function. This function deletes any internal record of the control and removes it from the parent window's client area. The following example shows how to destroy a control:

DestroyWindow(hEditWnd);

Windows automatically destroys a control when destroying the parent window. In general, you will need to destroy a control only if you no longer need it in the parent window.