I have MFC application and one of my views(derived from CFormView) has CHtmlView and some CEdit inside on it.
CHtmlView displays content of html file and I have a timer (CMyHtmlView::OnTimer), which refreshes this html view and displays new info. (CHtmlView::refresh function, see code attachment)
I have "introduced" shortcuts, so if user presses one of the shortcuts - relative CEdit will gain focus. This is done in CMyView::PreTranslateMessa
ge(see code attachment for example)
The problem is, that if I make left mouse click on CHtmlView, when I press F4(and CEdit will gain focus and selection),
then after the next time CHtmlView::refresh will be called, CEdit will loose focus.
If I select text in CEdit by mouse or I press F4 without mouse click on CHtmlView or even if I make mouse click on some other button/window/view/frame no matter what (and then I press F4) - after CHtmlView::refresh focus will still be on CEdit.
Any ideas, how to fix that?
P.S Sorry for my english :)
void CMyHtmlView::OnTimer(UINT nIDEvent)
m_bUpdateNeeded = FALSE;
Refresh();// load new content from file
BOOL CMyView::PreTranslateMessage(MSG* pMsg)