progress on program running

hi there,
please... how display a notice while the program logical-flux is running?

for conceptual example,
let printAnIntegerValue(int j) a function which use
(a) InvalidateRect(hwnd, NULL, false) to activate the WM_PAINT event;
(b) TextOut(hdc,x,y,lpcwstr,strlen) to draw the j-value (previously converted in LPCWSTR) on the window, through the redraw event;
and let this hypothetical loop: for (int k=0;k<1000;k++) printAnIntegerValue(k);

now, the behavior isn't that the label change into the loop, but at the end of cycle only the last redraw is made.
it is possible to obtain that k is printed while the loop is running?

The real case: i execute some operations over a great txt file, for example the lowercase conversion and many others. So i would like read the progress of this work, but i can't use for example a MsgBox because it require the human confirm at every time.

thank's
francesco

Basically you do the calculation in a second thread and use PostMessage to inform the main thread about the progress.

You can use a custom message or make 'k' to be thread safe.
Thank you :-), i go to study it
Topic archived. No new replies allowed.