Subj : Re: Dialog painting To : borland.public.cpp.borlandcpp From : Betkro Date : Mon Mar 21 2005 01:06 pm That's it! . Inserting the pumpwaitingmessages into the lengthy function is a easiest way to solve the problem. void MyDialog::LenghtyFunction(){ while (lenghtyProcessing){ MSG msg; if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } // process } } Thank you all, guys. betkro "Jeff Kish" escribió en el mensaje news:5gnt31p5lljm86kqlg550i16u9vdot9r53@4ax.com... > Wait.. can't you just put a pumpwaitingmessages call into your loop > (if you have one) in your lengthy processing? > > On Mon, 21 Mar 2005 10:06:28 -0300, "Sebastian Ledesma" > wrote: > > >Hello Betkro: > > > >You can do something like this: > > > >void SafeYield() { > > MSG msg; > > if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { > > TranslateMessage(&msg); > > DispatchMessage(&msg); > > } > >} > > > >int MyLongRunningFunction(....) { > >static int semaforo; > >if (semaforo) > > return; > >semaforo=1; > > > >while (processing) { > > SafeYield(); > > ... > >} > >semaforo=0; > >return result; > >} > > > >Saludos > >Sebastian > > > >"Betkro" escribió en el mensaje > >news:423d8b67$1@newsgroups.borland.com... > >> Hi, > >> I have a slow processing function in a dialog that begins after a > >MessageBox > >> confirmation. The MessageBox and overlapped region are repainted after the > >> function ends. Now, how can I repaint the dialog window before that? . > >> Thanks, > >> betkro > >> > >> > > > > Jeff Kish .