I have a VC++ MFC dialog application and in my OnTimer function I am just trying to determine which button in my dialog currently has focus.
Here is some pseudocode of what I am trying to accomplish….
CDialog::OnTimer()
{
CButton *btn = GetButtonOnFocus();
int btnID = btn->GetDlgCtrlID();
}
I haven’t tried it, but this should work:
This won’t restrict the result to buttons only – to do that, you need to use GetClassName and compare to “button”.