why CMFCToolBarButton::HasFocus() allways return No?

  • Thread starter Thread starter 凤凰与梧桐
  • Start date Start date

凤凰与梧桐

Guest
afxtoolbarbutton.h

HasFocus()like this

virtual BOOL HasFocus() const
{
HWND hwndBtn = ((CMFCToolBarButton*)this)->GetHwnd();
return hwndBtn != NULL && (hwndBtn == ::GetFocus() || ::IsChild(hwndBtn, ::GetFocus()));
}

GetHwnd() like this

virtual HWND GetHwnd() { return NULL; }

GetHwnd() return NULL, allways

so

hwndBtn =NULL,allways。

design fault

Continue reading...
 
Back
Top