Hi,
After chatting to some people on IRC about windows message handling, I remembered a bug I hit where a frozen window could kill everything because FindWindow sends a message to every window with no timeout (to get the window text).
Is this right? Wouldn't it be better to make FindWindow more robust by sending messages with a timeout so if one window in an app (or anothe process) has frozen, it doesn't kill the caller?
thanks -mike
Mike Hearn mike@theoretic.com writes:
After chatting to some people on IRC about windows message handling, I remembered a bug I hit where a frozen window could kill everything because FindWindow sends a message to every window with no timeout (to get the window text).
Is this right? Wouldn't it be better to make FindWindow more robust by sending messages with a timeout so if one window in an app (or anothe process) has frozen, it doesn't kill the caller?
FindWindow doesn't send messages to other processes, exactly for that reason. It does send them to other threads inside the same process, so it can hang if a thread is not responding. That's the way it's supposed to work according to MSDN.