1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| int ComboBox::OnToolHitTest(CPoint point, TOOLINFO * pTI) const
{
int row;
RECT cellrect;
BOOL tmp = FALSE;
PCOMBOBOXINFO info = new COMBOBOXINFO;
info->cbSize = sizeof(COMBOBOXINFO);
if (GetComboBoxInfo(info) == TRUE)
{
if (GetDroppedState())
{
listbox->Attach(info->hwndList);
row = listbox->ItemFromPoint(point,tmp);
if ( row == -1 )
return -1;
listbox->GetItemRect(row,&cellrect);
TRACE("row : %d\n", row);
pTI->rect = cellrect;
pTI->hwnd = m_hWnd;
pTI->uId = (UINT)((row));
pTI->lpszText = LPSTR_TEXTCALLBACK;
listbox->Detach();
delete info;
return pTI->uId;
}
}
int i = GetLastError();
delete info;
return 0;
} |