Does anyone know if you can use WaitForSingleObject on a window? I have a handle to the window (HWND) and I want to know when the user closes the window. WaitForSingleObject seems to only work on processes and not windows.

Your help is greatly appreciated.

Thanks