Fastream Technologies wrote:
>> Even if there were still such unregistered messages pending in the
>> message queue due to the hidden window still exists (handling
>> messages for other components of that thread) those unregistered
>> messages won't be touched by the component but handled by
>> DefWindowProc, so no problem. If the hidden window has been
>> destroyed Windows flushes the thread message queue so GetMessage()
>> should never see a message for a non-existing window.
>
> How does DefWindowProc work?
In this cases it removes those unregistered messages from the
queue, note that in this case the window still exists.
> What if the handle posted is no longer
> in that thread?
I think that's impossible, since GetMessage() or PeekMessage() won't retrieve
messages with an invalid window handle.
Your message pump may not work correctly, make sure that you
use this template:
while GetMessage(Msg, 0, 0, 0) do
begin
if (Msg.hwnd = 0) then //***
begin
**handle thread messages here (those posted by PostThreadMessage)**
end
else begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end;
--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be