If the target window is a top level window you can install a hook (see WH_SHELL) to be notified about destroying top level windows. But frankly, no matter what technique you use, you can be never sure. If everything looks ok and you send a message to that window, the window still can be destroyed in the same moment(almost the same). Or while is processing your message. Simply there is no way to prevent a foreign window from beeing destroyed anytime. The only thing you can do is to implement thoroughful error processing, verify the effects of each of the messages sent and check regularly if the handle is still for the same window and not reused for another one. Working with a foreign windows is something similar to working with dialog boxes. You can never be sure what stupidity will a user type in an edit box so you have to check everything. I think a window beeing destroyed exactly in the very moment when you need it, is a very rare occurence. Just make sure to limit to minimum the damages of such an event. If your software stops abruptly and hours of the user's unsaved work are gone, that's unacceptable. If the only thing that happens is an error message "Internal error, please repeat the last command", that's acceptable, even if it's not desirable. Even the best software fails sometimes. The only question is how it fails: disastruously or gracefully ?