Re: update window or invalidate or something

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Janiv Ratson (janiv_at_aoe6.net)
Date: 05/17/04


Date: Mon, 17 May 2004 10:15:57 +0200

Thanks all.
As U can C I M a newbie ...
But I tried using the timer, the problem was that the dialog did not get any
message, including WM_TIMER, so I couldn't use this method.
I'd really appreciate any help, but I think it is not a trivial task to make
both the MDI and the progress bar dialog repainted parallely.
It took me some time to figure that solution (it is based on a solution for
the same problem, which I got in this news group).

A sample will be great help, also any kinda help,
Thanks again,
Janiv.

"Scott McPhillips [MVP]" <scottmcp@mvps.org.nothere> wrote in message
news:eWiK9Q2OEHA.1960@TK2MSFTNGP10.phx.gbl...
> Janiv Ratson wrote:
> > Hi,
> > I have an MDI.
> > I also have a dialog which represent a progress bar.
> > When I show the progress bar dialog, the data behind (all MDI data) is
not
> > redrawn,
> > so it looks like in a middle of something.
> > I want the GUI in the back, to be drawn, how do I do it ?
> > 10x,
> > Janiv.
> >
> >
>
> I would guess that your are executing a loop and using the progress bar
> to show progress in the loop processing. The lack of redraws in the MDI
> data is caused by the looping, not by the progress dialog. When your
> code is looping it is not processing messages. You must process
> messages for painting to work.
>
> Eliminate the processing loop. One way is to use a timer (SetTimer) and
> do a brief amount of processing for each WM_TIMER message, and then
> return so message processing can resume.
>
> The best way (but much more difficult if you are a Windows newbie) is to
> put the processing loop in a separate thread.
>
> --
> Scott McPhillips [VC++ MVP]
>



Relevant Pages

  • Re: update window or invalidate or something
    ... As U can C I M a newbie ... ... But I tried using the timer, the problem was that the dialog did not get any ... both the MDI and the progress bar dialog repainted parallely. ... > put the processing loop in a separate thread. ...
    (microsoft.public.vc.mfc)
  • Re: Threading and the Progress Bar
    ... I'm going to try it without the timer. ... As for setting the thread priorities, I also generally avoid them like the ... As for updating the progress bar, why are you using a timer to indicate ... On one of these controls, ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Using Progress Bar
    ... The idea is to increment the progress bar in the timer control while your ... private void btnProcess_Click(object sender, System.EventArgs e) ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Running two routines at the same time
    ... as an alternative you might take a progress bar style approach and include ... I have an On Timer event in a form that flashes a label telling the user ...
    (microsoft.public.access.modulesdaovba)
  • Re: Timer
    ... In the timer tick method i get the signal strenght of a wireless ... I have this progress bar into a panel of the form. ... Every 1 second i refresh the value of the progressbar control. ... > runs separately from the user interface thread of the application ...
    (microsoft.public.dotnet.framework.compactframework)