The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
EM_SETCHARFORMATand SCF_SELECTION blocks rich editor behavio
#1
I have small code for highlighting the text.

m_ctlEdit.SendMessage(EM_EXSETSEL,0,(LPARAM)&cr);
CHARFORMAT2 cf;
memset(&cf,0,sizeof(cf));
cf.cbSize=sizeof(cf);
cf.dwMask=CFM_COLOR|CFM_BOLD|CFM_ITALIC|CFM_UNDERLINE|CFM_FACE|CFM_BACKCOLOR;
cf.crBackColor=GetSysColor(COLOR_WINDOW);
cf.crTextColor=GetSysColor(COLOR_WINDOWTEXT);
_tcscpy(cf.szFaceName,_T("Courier New"));
m_ctlEdit.SendMessage(EM_SETCHARFORMAT,SCF_SELECTION,(LPARAM)&cf);

But when i do this Undo/Redo operation is not working i.e ctrl Z. Instead of SCF_SELECTION if i use SCF_WORD it works fine. Where does the problem exist? Is it with SCF_SELECTION or my code?


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)