Eric,

I guess it helps to remove all pending messages with the given ID
from the queue when the message ID is unregistered.

One could do that either in custom code or maybe it should
be added in TIcsWndHandler.UnregisterMessage as below?

procedure TIcsWndHandler.UnregisterMessage(var Msg: UINT);
var
    LMsg: TMsg; // <== added
begin
    if Msg = 0 then
        Exit;
    if FMsgLow < WM_USER then
        raise EIcsException.Create('MsgLow not defined');
    if Msg >= (FMsgLow + WH_MAX_MSG) then
        raise EIcsException.Create('Msg value out of bound');
    if not Assigned(FMsgMap[Msg - FMsgLow]) then
        raise EIcsException.Create('Msg not registered');
    FMsgMap[Msg - FMsgLow] := nil;
    Dec(FMsgCnt);
    Msg := 0;
    while PeekMessage(LMsg, FHandle, Msg, Msg, PM_REMOVE) do {loop}; // <== 
added
    if FMsgCnt = 0 then
        DeallocateHWnd;
end;

-- 
Arno Garrels
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to