15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Receiving notifications from an edit box on the toolbar

Severino Delaurenti -- del@alpha.ico.olivetti.com
Monday, May 13, 1996

Environment: Windows 95, VC++ 4.0

I've put an edit box on my application toolbar: now I don't know how to =
receive a notification from the edit box itself when the user put a =
value into it and press CR.

Any suggestion ?

Thanks in advance.

                                Severino Delaurenti
                                Olivetti Lexikon Spa
                                Italy




DORIE@ris.risinc.com
Monday, May 20, 1996

I'm not sure if this is what you're looking for but I do something 
similar to this.  I have a descendant of a rich edit control on a 
toolbar.  Then when the text changes I need to know.  So what I do is 
in my frame, which is the parent of  my toolbar, I call 
myEdit.SetOwner(this).  Now I will get notification messages of my 
edit control and my toolbar will still be the parent of the edit 
control.  Now I add OnNotify to my frame and trap for EN_CHANGE.  
Here is a snipit of my code.  I use EN_SELCHANGE because I  
have a rich edit.
BOOL CBrowserFrame::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) 
{
	CString str;
	if ((((LPNMHDR)lParam)->code == EN_SELCHANGE) && 
		(m_bViewUpdate == TRUE))
	{

		m_RISEdit.GetRTFText(str);
		m_pBrowserView->ScrollToStr(&str);
		m_RISEdit.SetFocus();
	}
	return CMDIChildWnd::OnNotify(wParam, lParam, pResult);
}

Hope this helps.




| Вернуться в корень Архива |