This function must be called before terminating a thread or an application. Only the thread that called WinCreateMsgQueue may call this function with that handle.