The window to be destroyed must have been created by the thread that is issuing this call. Before hwnd is itself destroyed, all child windows of hwnd are also destroyed.

If hwnd cannot be destroyed, for example because hwnd is an invalid window handle or is not associated with the current thread, rc returns FALSE.

Note: If hwnd is locked, this call does not return until the window is unlocked (and destroyed).