有没有人遇到过啊?

解决方案 »

  1.   

    我在
    OnMouseMove中写的
    CListBox* pWnd=(CListBox*)WindowFromPoint(point);
    if(pWnd==NULL)
    return;
    pWnd->GetCount();
    结果为正确的 没问题
      

  2.   

    利用IsKindOf来判断是否是一个CListBox
    CWnd *pWnd = WindowFromPoint ( pt);
    if ( pWnd->IsKindOf(RUNTIME_CLASS(CListBox))
    {
    ...
    }
      

  3.   

    static CWnd* PASCAL WindowFromPoint( POINT point );Return ValueA pointer to the window object in which the point lies. It is NULL if no window exists at the given point. The returned pointer may be temporary and should not be stored for later use.关键是你在什么地方用了?这个返回的指针不能保存的