I have a busy process where the statusbar on a form is updated with new text, or at least it should be updated.
Unfortunately although I send new text to the statusbar it doesn't get redrawn until the process completes.
Exactly what do I have to do in order to get the statusbar to instantly update?
Andrew
You have to allow for a breath. In the latest version of my COM browser, I have many loops, and put a call to the following function to allow both to show the progress in the status bar and to allow to abort the process clicking a button.
SUB TLB_DoEvents (BYVAL hDlg AS DWORD)
LOCAL Msg AS tagMsg
WHILE PeekMessage(Msg, %NULL, %NULL, %NULL, %PM_REMOVE)
IF ISFALSE IsDialogMessage(hDlg, Msg) THEN
TranslateMessage Msg
DispatchMessage Msg
END IF
WEND
END SUB
The statusbar is very slow in updating. I usually update the text at the end of the functions. Also make sure you have DoEvents somewhere in the loop...after the SB update would be best. If that still doesn't cut it, update/redraw the SB after updating the text. FF is nice in supplying you the handle.
Oops, Jose posted as I was watching TV and typing. Great minds think alike though. Paul made a nice DoEvents FF function too. And it works with his new Dialog style Events just as Jose's does.