is there any way to change the font in a control without having it be set in the undo buffer? (like, for my case, I'm using it in a syntax highlighter, but it REALLY screws up the undoing whenever i call it, so it basically ends up making it so that i can't undo anymore without undoing font settings and making the syntax highlighting go crazy...)
here's my basic code that i use:
-note-Code:SendMessage(hCtrl,WM_SETREDRAW,0,0); int started,end; SendMessage(hCtrl,EM_GETSEL,(WPARAM)&started,LPARAM)&end); POINT ScrollPos; SendMessage(hCtrl,EM_GETSCROLLPOS,NULL,(LPARAM)&ScrollPos); long dwEventMask=(SendMessage(hCtrl,EM_GETEVENTMASK,0,0)); SendMessage(hCtrl,EM_SETEVENTMASK,0,dwEventMask^=ENM_CHANGE); // then we do that actual coloring of the code which involves a lot of selecting and font changing...... CHARRANGE select2={started,end}; SendMessage(hCtrl,EM_EXSETSEL,0,(LPARAM)&select2); SendMessage(hCtrl,EM_SETSCROLLPOS,NULL,(LPARAM)&ScrollPos); SendMessage(hCtrl,EM_SETEVENTMASK,0,dwEventMask|=ENM_CHANGE); SendMessage(hCtrl,WM_SETREDRAW,1,0); RedrawWindow(hCtrl,NULL,NULL,RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE);
This richedit control can support over 10000 undos....that's why i need to fix this. If my editor only had one undo, i suppose it wouldn't matter, but i'd like to be able to undo more (i suppose I could figure out my own "undo algorithm" or something)



LinkBack URL
About LinkBacks


