MDI focus problem
- From: "markww" <markww@xxxxxxxxx>
- Date: 8 Aug 2006 19:11:38 -0700
Hi everyone,
I have a standard MFC MDI app. I have a bunch of views open at the same
time. I want to draw a hilite box around the view that has focus at the
moment. But I'm not sure how to do this since I seem to be receiving my
messages wrong. I though for starters I could just do this in the view
class:
void CMyView::OnLButtonDown()
{
::SendMessage(this->GetSafeHwnd(), WM_SETFOCUS, 0, 0);
}
void CMyView::OnSetFocus()
{
this->m_bFocus = true;
this->Invalidate(); // draw focus box around me now.
}
void CMyView::OnKillFocus()
{
this->m_bFocus = false;
this->Invalidate(); // erase focus box around me now.
}
Yeah but it seems like if I click the title bar of the view it fails
miserably. What messages should I handle so I don't end up with 5
'focused' views at once, or none at all?
Thanks
.
- Follow-Ups:
- Re: MDI focus problem
- From: Joseph M . Newcomer
- Re: MDI focus problem
- From: Ajay Kalra
- Re: MDI focus problem
- Prev by Date: Re: What MFC Objects Can't be created on the Stack?
- Next by Date: Re: What MFC Objects Can't be created on the Stack?
- Previous by thread: owner-draw list control
- Next by thread: Re: MDI focus problem
- Index(es):