Dialog Box & Progress Bar

I've never done this before so I'd appreciate some advice on the best way to it. I get list box items from a list box, put them into a string, then write them to a file. On extremely rare occassions, the number of list box items could be so large that it takes a few moments to gather all the strings before writing to disk.

Thus, I'd like to display a dialog box with a progress bar that opens at a certain file size, displays the progress, and then closes after the information has all been gathered into the string.

I thought I'd just go ahead and create a modeless dialog box and stick a progress bar in there with the relevant boundaries.

However, I'm not sure #1 if that's the best way to do it, and #2, how to make the dialog close once I've done it, if that's the best way to do it.

Any advice would be appreciated.
Are you using MFC?
Closing the dialog gan be done by calling EndDialog member function.
If it is the best way I can't tell you, but if I have understood you correctly this should be a possibility. The "relevant boundaries" might turn out as the most difficult part.
No, I'm using straight Win32 API. The revelant boundaries would simply be 0 to however many items were in the list box, so I'm not sure why that would be a problem, although, as I said, I've never done this before.

So if I'm using Win32 API, how would I call the EndDialog() procedure at a specific time, i.e., when the parent process, i.e., the gathering of the strings from the list box, was finished?
It's a Win32 FAQ (http://tinyurl.com/cmhb5g)
That seems like a good site, but I'll be darned if I can find anything there about a progress bar. The search on "progress bar" comes up empty.
Topic archived. No new replies allowed.