Re: CComboBox behaviour

Tech-Archive recommends: Fix windows errors by optimizing your registry



I think you are actually right. I thought the drop list didn't gain capture
again because there were no WM_CAPTURECHANGED messages sent that would show
that. It seems that it misled me.

I finally wrote my left button handler this way :

void MyClass::OnLButtonDown(UINT nFlags, CPoint point)
{
// this part deals with translating NC message

CPoint screenPoint = point;
ClientToScreen(&screenPoint);
LRESULT res = SendMessage(WM_NCHITTEST, NULL, MAKELONG(screenPoint.x,
screenPoint.y));

if (res != 0)
{
ReleaseCapture();
if (!SendMessage(WM_NCLBUTTONDOWN, res, MAKELONG(screenPoint.x,
screenPoint.y)))
SetCapture();
return;
}

// my own custom treatment

...

ParentClass::OnLButtonDown(nFlags, point);
}

And I added a "if (GetCapture() != this) SetCapture();" in the VSCROLL
handler, and it seems to work correctly so far, and also seems to dispatch
messages the same way ComboLBox does.

I hope I didn't miss some issue, and that this can be helpful to someone
else.

Thank you for your help.

"Jeff Partch [MVP]" <jeffp@xxxxxxxx> a écrit dans le message de news:
%23NleabfZFHA.1368@xxxxxxxxxxxxxxxxxxxxxxx
> "Yannick ROUSSEAU" <ryannick@xxxxxxxxxxxxxx> wrote in message
> news:429c66cf$0$169$a3f2974a@xxxxxxxxxxxxxxxxxxxxxxx
>> The message tracking report doesn't suggest that. Plus I don't see how
>> one
>> would detect being just before message processing.
>
> Sorry for wasting your time, Yannick.
> --
> Jeff Partch [VC++ MVP]
>
>


.


Quantcast