Alternative to (Un)LockWindowUpdate ?
mlauer@stud.uni-frankfurt.de Tuesday, June 04, 1996 ENV: VC4.1 / NT4 / 95 Hello, my application provides syntax-highlighting similar to vc's source window by using the CRichEditCtrl. To prevent flickering and to accelerate the color-formatting, I must prevent my CRichEditCtrl from updating while I do all the SetSel & SetSelCharFormat calls. I have tried with (Un)LockWindowUpdate, but it seems that the MSDEV environment uses LockWindowUpdate, as well as the "NewShell" SysListView32 desktop => I can't use this method, because (why?) Win32 only allows one window in the system to be locked. Can anyone think of another way to prevent redrawing ? Must I intercept all WM_PAINT calls to the CRichEditCtrl and keep tracking of the update rectangle myself ? Regards, -===============================================================================- - Michael 'Mickey' Lauer - -===============================================================================- - http://www.rz.uni-frankfurt.de/~mlauer || mailto:mlauer@stud.uni-frankfurt.de - -===============================================================================- - "Guess who's coming to dinner" (Commander Chekov, StarTrek VI) - -===============================================================================-
Roger Onslow -- Roger_Onslow@compsys.com.au Wednesday, June 12, 1996 Mickey, >my application provides syntax-highlighting similar to vc's source >window by using the CRichEditCtrl. To prevent flickering and to accelerate >the color-formatting, I must prevent my CRichEditCtrl from updating while >I do all the SetSel & SetSelCharFormat calls. I have tried with >(Un)LockWindowUpdate, but it seems that the MSDEV environment uses LockWindowUpdate, >as well as the "NewShell" SysListView32 desktop => I can't use this method, because >(why?) Win32 only allows one window in the system to be locked. Can anyone think >of another way to prevent redrawing ? Must I intercept all WM_PAINT calls to >the CRichEditCtrl and keep tracking of the update rectangle myself ? We had similar problem (tried LockWindowUpdate etc), but found much simpler solution using "HideSelection" code looks like this... CRichEditCtrl& RichEditCtrl = GetRichEditCtrl(); CHARRANGE cr; RichEditCtrl.GetSel(cr); RichEditCtrl.HideSelection(TRUE,FALSE); // // stuff about with selections and colors etc... // RichEditCtrl.HideSelection(FALSE, FALSE); RichEditCtrl.SetSel(cr); Hope this helps... Roger Onslow
| Вернуться в корень Архива |