Jump to content
  • Advertisement
Sign in to follow this  
Lost

Looking for help with progress bar in Windows dialog based program

This topic is 4123 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

As the subject says, I'm looking for help with progress bar in Windows dialog based program. I have Googled, assotered tutorials and looked at MSDN library and I'm either not finding what I need or not getting it. I have added the progress bar to the dialog and know the ID and such, but I don't know how to update it. If anyone is able to help me get this working, it would be huge help. Thanks

Share this post


Link to post
Share on other sites
Advertisement
If it is any help. The dialog, is fairly stock MFC dialog template. All the heavy work is/was done in a console and then added to the dialog.

Share this post


Link to post
Share on other sites
in general what you do is in your code, in WM_INITDIALOG, is use GetDlgItem to get the handle to the progress bar control. then, you initialize the range of the control by sending the control the PBM_SETRANGE32 message. then you also initialize the current value of the control by sending the control the PBM_SETPOS message.

then how you proceed after this depends if you are using threads and a modal dialog, or not using threads and using a modeless dialog with a message pump.

check this link out. it's MFC, but can easily be adapted to win32. it takes the modeless wait dialog method (no threads, modeless dialog with message pump). i recommend chucking the OnIdle call in the message pump, however, as it really slows down the message pump. ever since i saw this article in MSDN mag way back when, this is the method i prefer (beats using threads, unless you need multiple processes going at the same time, but for one thing this works fine).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!