Arno Garrels wrote:
> 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?

Previous code did remove message ID 0 (I should not code in OE 8-)
corrected code:

procedure TIcsWndHandler.UnregisterMessage(var Msg: UINT);
    LMsg: TMsg; // <== added
    if Msg = 0 then
    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;
    while PeekMessage(LMsg, FHandle, Msg, Msg, PM_REMOVE) do {loop}; // <== 
    Msg := 0;
    if FMsgCnt = 0 then
To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to