Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find and highlight text in other app using regular expresion
#36
To reset color:
In RichEditHighlight replace if/else code starting from if(IsWindowUnicode(hwndre)). In my version it was 12 lines to replace.
Code:
Copy      Help
CHARFORMAT2W cfw.cbSize=sizeof(cfw)
if(color) cfw.dwMask|CFM_BACKCOLOR; if(color=-1) cfw.dwEffects=CFE_AUTOBACKCOLOR; else cfw.crBackColor=color
if(textcolor) cfw.dwMask|CFM_COLOR; if(textcolor=-1) cfw.dwEffects=CFE_AUTOCOLOR; else cfw.crTextColor=textcolor
if(flags&128) cfw.dwMask|CFM_BOLD; cfw.dwEffects=CFE_BOLD
if(IsWindowUnicode(hwndre))
,m.Write(&cfw sizeof(cfw))
else
,CHARFORMAT2A cfa.cbSize=sizeof(cfa)
,cfa.dwMask=cfw.dwMask; cfa.crBackColor=cfw.crBackColor; cfa.crTextColor=cfw.crTextColor; cfa.dwEffects=cfw.dwEffects
,m.Write(&cfa sizeof(cfa))
Then can use -1 for color or textcolor to reset to default color.
Updated here: Find and highlight text in other app using regular expresion

Updated EditControlSelectReplace: Selecting text within a text field


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)