Click here to Skip to main content
15,914,163 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi, hello everyone.

i try to use windowlessRichedit,i have a problem.
i find that,the function ITextHost::TxNoTify can't receive EN_CHANGE.here, i can receive,EN_UPDATE,EN_SETFOCUS,EN_KILLFOCUS and so on,but without EN_CHANGE.

so i don't know the change of the richedit.

can you help me?

the key code:
C++
HRESULT CTxtWinHost::TxNotify(DWORD iNotify, void *pv)
{
	if( iNotify == EN_REQUESTRESIZE )
	{
		RECT rc;
		REQRESIZE *preqsz = (REQRESIZE *)pv;
		
		GetControlRect(&rc);
		rc.bottom = rc.top + preqsz->rc.bottom + HOST_BORDER;
		rc.right  = rc.left + preqsz->rc.right + HOST_BORDER;
		rc.top -= HOST_BORDER;
		rc.left -= HOST_BORDER;
		
		SetClientRect(&rc, TRUE);
		
		return S_OK;
	} 
	if(iNotify==EN_CHANGE)
	{
                // it shall run here but it don't
		int a=0 ;
		sleep(1000);
	}

	// Forward this to the container
	if (pnc)
	{
		(*pnc)(iNotify);
	}

	if(!cfCallBackFun.isEmpty())
		cfCallBackFun(iNotify);

	if (iNotify==EN_OLEOPFAILED)
	{
		return S_FALSE;
	}

	return S_OK;
}


3Q
dawei.lin 2012-11-05
Posted

1 solution

See the remarks section of the EN_CHANGE[^] notification code in the MSDN:
Quote:
Rich Edit: To receive EN_CHANGE notification codes, specify ENM_CHANGE in the mask sent with the EM_SETEVENTMASK message.
 
Share this answer
 
Comments
lin98666521 5-Nov-12 9:06am    
thanks very much.
I try to solve the problem.
I think that Your answer is right.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900